In some cases it is valuable to know- for example a DTD "EMPTY" specification can contain a CDATA section so I can't tell from the DTD whether an empty element is capable of having text or not.  Our product allows the creation of XML target documents by mapping data from another data source.  I'm working on a process to force a document to conform to a DTD automatically and the process is complex but basically for my purposes I need to be able to detect whether or not my mapping engine generated the document with a CDATA section or not as part of a ruleset.  The easiest way would be to interrogate the dom4j Document...  Sorry, I know that isn't much of an explanation of "why" I need to know about CDATA.

David Thielen wrote:
015601c1cb9b$2cd4af70$69f72dc7@BAMBI">
I believe the answer is that at the DOM level it's not supposed to matter,
and therefore you don't & can't know if it's CDATA.

- dave


----- Original Message -----
From: "Brian Young" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 14, 2002 12:28 PM
Subject: [dom4j-user] problem detecting CDATA


I'm writing some code where I need to know whether an element contains a
CDATA section or not, but am having trouble determining this with the
top level dom4j interfaces. Element.getText() obviously just returns a
String representing all of the text whether it was in a CDATA section or
not.

It is rather likely I am just missing something- so please point me in
the right direction.....

Thanks


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user







Reply via email to