Skip to Content.
Sympa Menu

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

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: cowwoc <cowwoc AT bbs.darktech.org>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Getting an element value, excluding its children
  • Date: Fri, 08 Aug 2008 20:25:53 -0700

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




Archive powered by MHonArc 2.6.24.

Top of Page