• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

how to get the whole NodeList

 
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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']
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic