Re: XmlValue navigation problem -
01-12-2006
, 10:31 AM
Ventura,
The XmlValue navigations methods are small wrappers around
the DOM (Document Object Model) interfaces, which can be confusing.
DOM does not specify any node value for element nodes, as you might
think (and expect), so the behavior you are seeing is correct.
In order to get the text value of the node, you need to navigate to
*its* child (text) node -- something like:
val.getFirstChild().getNodeValue()
When using these interfaces, be wary of white space in your documents,
which shows up as unexpected text nodes during
navigation. It's a good idea to test that a node is of the type
you expect before doing much with it.
Regards,
George Feinberg
Sleepycat Software |