Hi,
I am parsing a simple XML document using jaxp.
the XML structure is like this:
<employees>
<employee></employee>
<employee></employee>
<employee></employee>
</employees>
After loading the xml, I have the following code:
sLength=doc.getDocumentElement().getChildNodes().getLength();
sEmpNode=doc.getDocumentElement();
for( i=0;i<sLength;i++){
System.out.println(sEmpNode.getChildNodes().item(i).getNodeName());
}
I was expecting 3 nodes to be displayed, namely "employee"..but it displays 7 like this:
#text
employee
#text
employee
#text
employee
#text
I don't understand why it displays #text and what the hell is that?
nims
I am parsing a simple XML document using jaxp.
the XML structure is like this:
<employees>
<employee></employee>
<employee></employee>
<employee></employee>
</employees>
After loading the xml, I have the following code:
sLength=doc.getDocumentElement().getChildNodes().getLength();
sEmpNode=doc.getDocumentElement();
for( i=0;i<sLength;i++){
System.out.println(sEmpNode.getChildNodes().item(i).getNodeName());
}
I was expecting 3 nodes to be displayed, namely "employee"..but it displays 7 like this:
#text
employee
#text
employee
#text
employee
#text
I don't understand why it displays #text and what the hell is that?
nims