aspose file tools*
The moose likes XML and Related Technologies and the fly likes java and xpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "java and xpath" Watch "java and xpath" New topic
Author

java and xpath

Sudarshan Sreenivasan
Ranch Hand

Joined: Jun 28, 2007
Posts: 188

I have been working on java and xml for a bit and have this confusion the details of my test case are given below

Look at the highlighted sections of Actual and expected results

I was hoping to pick up 882 for the second node in the node list however the parser does not seem to agree.

Can anyone tell me why or should this be yet another bug in the oracle V2 parser ?


The sample xml file




The java Code




Acutal Output



iCount--> 0
<intermediary type="IFA" id="ID000019" sequence_number="1">
<sib_number>881</sib_number> <!-- AgentCode -->
<tpsdata/>
</intermediary>
sib_number881
iCount--> 1
<intermediary type="IFA" id="ID9" sequence_number="1">
<sib_number>882</sib_number> <!-- AgentCode -->

<tpsdata/>
</intermediary>
sib_number881
nlTest.getLength() 2







Expected output



iCount--> 0
<intermediary type="IFA" id="ID000019" sequence_number="1">
<sib_number>881</sib_number> <!-- AgentCode -->
<tpsdata/>
</intermediary>
sib_number881
iCount--> 1
<intermediary type="IFA" id="ID9" sequence_number="1">
<sib_number>882</sib_number> <!-- AgentCode -->

<tpsdata/>
</intermediary>
sib_number882
nlTest.getLength() 2


Sudarshan Sreenivasan
Ranch Hand

Joined: Jun 28, 2007
Posts: 188

Hi,

I with a little help have found the solution to the problem, I have also updated the forum given below,the solution could be understood only if one goes through the problem posted earlier.

Use


OR


instead of


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java and xpath