[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. 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. Replies:
    0
    Views:
    1,648
  2. Alex D.
    Replies:
    0
    Views:
    718
    Alex D.
    Dec 27, 2005
  3. Jeff
    Replies:
    2
    Views:
    1,095
    Dimitre Novatchev
    Jul 5, 2003
  4. cvissy
    Replies:
    0
    Views:
    637
    cvissy
    Nov 16, 2004
  5. Tjerk Wolterink
    Replies:
    2
    Views:
    1,505
    Dimitre Novatchev
    Aug 24, 2006
Loading...

Share This Page