You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Al...@pb.com on 2002/08/14 20:25:59 UTC

defining CDATA for elements

how can i define an element to only contain CDATA ??

<!ELEMENT _CFSLogId (#PCDATA)>

the reason i ask is that i am assuming that the first child ( 
node.getChildNodes() ) of an ELEMENT_NODE will be the #text NODE 
containing the content for this  element.

since the definition is PCDATA, the child node could be another element 
...




RE: defining CDATA for elements

Posted by Tom Wang <to...@panscopic.com>.
Alan,

CDATA is for attributes only.  You can check the node type to find out if
the child node is a text node or element node.

Tom Wang
Panscopic Corporation
Report All That You Can Report
http://www.panscopic.com/


  -----Original Message-----
  From: Alan.Gerhard@pb.com [mailto:Alan.Gerhard@pb.com]
  Sent: Wednesday, August 14, 2002 11:26 AM
  To: xerces-j-user@xml.apache.org
  Subject: defining CDATA for elements



  how can i define an element to only contain CDATA ??

  <!ELEMENT _CFSLogId (#PCDATA)>

  the reason i ask is that i am assuming that the first child (
node.getChildNodes() ) of an ELEMENT_NODE will be the #text NODE containing
the content for this  element.

  since the definition is PCDATA, the child node could be another element
...