File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java and xpath

 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 188
IntelliJ IDE Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic