Can we realy have text as apart of an empty element ? Consider the following example - <abc> Hello <pqr value="10" /> How are you ? </abc> In the above example I believe <pqr> is an empty element. The text nodes are 1)Hello 2)How are you ? Which element do they belong to - <abc> or <pqr> ? I am not sure ! Avinash.
Text is treated as a child node and hence cannot be part of an empty element; It can have any number of PIs though as shown here - <!DOCTYPE root SYSTEM "sample.dtd"[ <!ELEMENT root ANY> <!ATTLIST root attr1 CDATA #REQUIRED> <!ELEMENT jayadev EMPTY> <!ATTLIST jayadev dev CDATA "pulaparty"> ]> <root attr1="att1"> <jayadev dev="jpulapar"><?PIData xxxx=yyyy ?></jayadev> </root>