Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xpath select all nodes under document root

Reply
Thread Tools

xpath select all nodes under document root

 
 
eggie5
Guest
Posts: n/a
 
      10-02-2007
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.

 
Reply With Quote
 
 
 
 
Joseph Kesselman
Guest
Posts: n/a
 
      10-02-2007
eggie5 wrote:
> 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...?



--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xpath to select text nodes and <br> Marek XML 1 06-24-2008 08:40 PM
Modifying DOM Document Nodes using XPath O.B. Java 1 02-01-2006 07:23 PM
Should Xpath select nodes containing default values?? aman.coe@gmail.com XML 2 10-22-2005 03:30 AM
mz js select nodes with xpath, having by specific attribute named'class' the 'subvalue part' set Marek Mänd Javascript 1 02-20-2005 04:43 PM
XPath: How to select all nodes which don't have children` Hannes Heckner XML 1 10-13-2003 09:43 AM



Advertisments