xpath select all nodes under document root

Discussion in 'XML' started by eggie5, Oct 2, 2007.

  1. eggie5

    eggie5 Guest

    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.
     
    eggie5, Oct 2, 2007
    #1
    1. Advertising

  2. 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
     
    Joseph Kesselman, Oct 2, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. O.B.
    Replies:
    1
    Views:
    1,396
  2. Hannes Heckner
    Replies:
    1
    Views:
    784
    Martin Honnen
    Oct 13, 2003
  3. Replies:
    2
    Views:
    892
  4. Marek
    Replies:
    1
    Views:
    1,640
    Marek
    Jun 24, 2008
  5. Marek Mänd
    Replies:
    1
    Views:
    307
    Martin Honnen
    Feb 20, 2005
Loading...

Share This Page