realbasic-nug
[Top] [All Lists]

Re: XML CDATA handling

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: XML CDATA handling
From: Stephen Tallent <stephen at tallent dot com>
Date: Tue, 30 Nov 2004 10:55:49 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <opsh9inq0r2tqf3s at mail dot internode dot on dot net>
Is there a way to force the XML classes to preserve the type of CDATA
nodes and not coalesce neighbouring CDATA nodes?

I doubt it because I believe per the XML spec, they are functionally the same. I don't think you can have 2 distinct CDATA nodes within one element. All a CDATA tag does is tell the parser how to deal with the textual data in the text node, but it is still functionally a text node. And text nodes can't really have children or siblings (your trying to give a text node a sibling). It is essentially asking the parser to deal with <root>alpha beta</root> and have it treat alpha and beta as two distinct TextNodes. The RB parser is expat down under the hood which is a good thing. When you see behavior like this, you can pretty much count on the fact it is because the spec told expat to deal with it like this. I could be completely wrong on this, so feel free to check the spec, but I think RB's behavior is correct so you will need to figure out a different way to design your XML to accomplish your goal.

-stephen

===========================
Stephen Tallent
Tallent Communications, Inc.
stephen at tallent dot com
http://www.tallent.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>