wood burning stoves
The moose likes Java in General and the fly likes Xpath Expression correction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Xpath Expression correction" Watch "Xpath Expression correction" New topic

Xpath Expression correction

Jose Campana
Ranch Hand

Joined: May 28, 2007
Posts: 339
Hello There!

It's a pleasure to be posting here, and well, I have a problem I can't figure out on my own, So I hope somebody can Help Me.

Here's the deal:

I need to correct an XPath expression I'm building so that it selects ALL the FIELD elements in the Following XML:

<?xml version="1.0" standalone="yes"?>
<GROUP ID="060451" Name="CIE">
<FIELD Format="X(17)" ID="DefaultString1" />
<FIELD Format="XX" ID="DefaultString2" />
<FIELD Format="9(5)" ID="DefInteger1" />
So far my expression looks like this:


But it only CAPTURES the First FIELD element...
To clarify, I use this snippet:

And it only prints out DefaultString1, and I need to get it to print:

like in a loop, so that I can store each value in a String array.

Could anybody Please help Me, I'm really in need... I have tried many different ways to make it work, but I haven't been successful yet.

I wish good luck to everyone reading this post,
Best Regards,
Jose Campana
Ranch Hand

Joined: May 28, 2007
Posts: 339
Al right Guys,

I figured this one out on my own..

Thanks anyways !

Take care !

Your Friend,
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
Nice to see that you have worked it out!

So, how did you do it?

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I agree. Here's the link: http://aspose.com/file-tools
subject: Xpath Expression correction
It's not a secret anymore!