>I'm trying to print out the Node values of a DOM_Node using getNodeValue()
after
>parsing the document through DOM_Parse::parse(). But it prints out null.
See the DOM spec. Not all nodes have node values. Elements, in particular,
always have the node value null; to examine their contents, you must
explicitly examine their descendents and attributes.
This is very deliberate. There's no single clear definition of the "value"
of an element which will work for all applications, so the DOM -- and the
XML Information Set -- left this as something for each individual
application to work out and implement for itself, to suit its own needs.
If what you're looking for is just the contained text -- which is rarely
the right answer for any but the innermost elements -- DOM Level 3 is
considering introducing convenience routines to make extracting that
information easier. Meanwhile, the DOM Level 2 "Range" feature can provide
some assistance, as can the DOM Level 2 Traversal feature with its
"filtered view" of the document.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]