[xerces-c] How to access a particular node?

Discussion in 'XML' started by Rene, Jan 27, 2004.

  1. Rene

    Rene Guest

    Hi,

    Newbie alert...
    I'm using Xerces-C as a DOM parser.
    I got it validating, and can retrieve/walk my XML nodes.
    However, I'm missing some functionality.

    Given this example XML file:

    <companies>
    <company1>
    <address>
    <street/>
    <phone/>
    </address>
    <managers>
    <ceo>
    <name/>
    <phone/>
    </ceo>
    <cio>
    <name/>
    <phone/>
    </cio>
    </managers>
    </company1>
    <company2>
    <...>
    </company2>
    </companies>

    When I want the phone# of company1 I can of course walk my nodes and
    finally arrive at company1/address/phone, but this is cumbersome
    Using getElementsByTagName("phone") will receive *all* phone nodes, so
    not only that of company1 but also of all managers.
    I'd like to use something like get
    getElement("/company1/address/phone").
    I believe MSXML has something like this (getSingleNode?).
    Is this also possible in Xerces-C?

    Thanks,
    Rene
     
    Rene, Jan 27, 2004
    #1
    1. Advertisements

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. wolf
    Replies:
    0
    Views:
    669
  2. Replies:
    0
    Views:
    1,915
  3. Alex D.
    Replies:
    0
    Views:
    762
    Alex D.
    Dec 27, 2005
  4. Replies:
    0
    Views:
    487
  5. Jeff
    Replies:
    2
    Views:
    1,262
    Dimitre Novatchev
    Jul 5, 2003
  6. cvissy
    Replies:
    0
    Views:
    832
    cvissy
    Nov 16, 2004
  7. Tjerk Wolterink
    Replies:
    2
    Views:
    1,719
    Dimitre Novatchev
    Aug 24, 2006
  8. Luqman
    Replies:
    2
    Views:
    1,057
    Luqman
    Jun 5, 2007
Loading...