[XOM-interest] Getting an element value, excluding its children

Elliotte Harold elharo at metalab.unc.edu
Fri Aug 8 23:25:53 EDT 2008


cowwoc wrote:
> Hi,
> 
>     Given:
> 
> <version>1.0.2.3
>   <message>this is a test</message>
> </version>
> 
>     How does one get "1.0.2.3" back from XOM? I tried Element.getValue() 
> but it includes the value of the children nodes (i.e. "this is a test"). 
> Any ideas?
> 

You'll need to get the child node and then take its value.

element.getChild(0).getValue();



-- 
Elliotte Rusty Harold  elharo at metalab.unc.edu
Refactoring HTML Just Published!
http://www.amazon.com/exec/obidos/ISBN=0321503635/ref=nosim/cafeaulaitA


More information about the XOM-interest mailing list