xpath select all nodes under document root

E

eggie5

All I want to do is select all the nodes under the docment root. e.g:

<?xml version="1.0" encoding="UTF-8"?>
<Categories>
<Category>
<content_provider_id type="integer">1</content_provider_id>
<id type="integer">2</id>
<name>Traffic Alerts</name>
</Category>
<Category>
<content_provider_id type="integer">1</content_provider_id>
<id type="integer">1</id>
<name>News Alerts</name>
</Category>
<Category>
<content_provider_id type="integer">1</content_provider_id>
<id type="integer">3</id>
<name>testing category</name>
</Category>
</Categories>


What xpath would return all the Category nodes? But I don't want it to
be specific to this xml file.
 
J

Joseph Kesselman

eggie5 said:
All I want to do is select all the nodes under the docment root

Um.... Do you mean anywhere in the tree ("//Category"), or all that are
under the top-level element whatever it happens to be ("/*/Category"),
or all second-level nodes ("/*/*"), or...?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top