Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Element.getValue()

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Nils_Kilden-Pedersen AT Countrywide.Com
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Element.getValue()
  • Date: Thu, 22 May 2003 13:44:23 -0700

You could do something like this:

for (int i = 0; i < rung.getChildCount(); i++) {
Node node = rung.getChild(i);
if (node instanceof Text) {
// Do something
}
}



xom-interest-bounces AT lists.ibiblio.org wrote on 05/22/2003 12:35:39 PM:

>
> Here is an example Element:
>
> <rung>
> <cmt flags="0">This is a rung comment. It is optionally included as
> part of a rung</cmt>
> <!-- rung proper, the Text part: -->
> XIC I:0/0 OTE O:12
> </rung>
>
> When getValue() is called on Element <rung>, it returns the text of the
> nested <cmt> preceding the text of the <rung>. XOM needs a method to
> return only <rung>'s text:
>
> "XIC I:0/0 OTE O:12"
>
>
> Please don't suggest that I change the grammar of my XML to stoop to
> XOM's capabilities. That would be _dangerous_ :) to me.
>
> Is there a capability in XOM that I don't see?
>
>
>
>
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest
>






Archive powered by MHonArc 2.6.24.

Top of Page