• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get the whole NodeList

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<University>
<Department name="Math" ....>
<address ..>
</Department>

<Department name="History" ..>
<address ...>
</Department>

<Department ...
..
</Department>
</University>

I want to get a "NodeList" of <Department>, i.e a list of <Department>s. However, when I do

XPathAPI.selectNodelist(Document, "/root/.../University/");

It returns an "Element". How to select an entire list of <Department>s as a NodeList ?

Thanks.
 
Miguel Capo
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that the following expression should give you all the nodes that you are after


/*[name()='document']/...../*[name()='University']/*[name()='Department']
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic