> ... in between
> the tags (as opposed to an attribute) it considers that text to be a
> child node of the named tag.
This is by design, consult the W3C DOM spec.
It actually is considered a child text node of the element (tag). I believe
this is something that most parsers (Xerces excluded) implements incorrectly
(MSXML comes to mind).
This is further evident in XPath with an expression like:
"html:html/html:head/html:title/text()" which, with the text() expression
excluded, would return the html:title element node instead of the text node.
- Ryan
-----Original Message-----
From: Ryan Alexander [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 11, 2001 12:21 PM
To: [EMAIL PROTECTED]
Subject: Xerces parser 1.2.3 strangeness...
I have a SOAP installation under J-Run.
I installed the Xerces parser version 1.2.3 as I understand that's the
appropriate one to use.
I was testing it with just some XML handling and I noticed something
really *weird*
It appears that if you put your values in the XML document in between
the tags (as opposed to an attribute) it considers that text to be a
child node of the named tag.
In other words where:
String title =
tempE.getElementsByTagName("title").item(0).getNodeValue();
Would seem appropriate, instead:
String title =
tempE.getElementsByTagName("title").item(0).getFirstChild().getNodeValue
();
Is required.
Could someone confirm that this is the case?
Would anyone know why it would behave this way?
-Ryan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]