Re: How to query and edit nodes in an xml doc /dataset?

Discussion in 'ASP .Net' started by PJ, Jun 25, 2003.

  1. PJ

    PJ Guest

    use xpath http://www.w3.org/TR/xpath
    xpath staments will be your queries into your xml instance.

    XmlDocument doc = new XmlDocument(xmlInstance);
    String xpath = "/station/@label";

    if ( doc.SelectSingleNode(xpath).Value == myVar )
    {
    //do something or check something
    }

    ~PJ

    "KathyB" <> wrote in message
    news:...
    > Hi, I'm working with an xml structure that is NOT database
    > centric...it does not fit the column/rows model.
    >
    > I need to be able to load an xml doc file into memory, then query that
    > info and update/add nodes as needed. For example:
    >
    > <station name="label">
    > <work_instructions order="1" title="Apply Labels">
    > <boards>
    > <board serial_no="111">
    > <board serial_no="222">
    > </boards>
    > </work_instructions>
    > </station>
    >
    > I need to be able to say: if station @name = varStation (variable)
    > then
    > do something, or check something, etc.
    >
    > Could someone please point me to some examples? I'm only finding
    > database-structured xml used as examples and it isn't helping me!
    >
    > Thanks.
    >
    > Kathy
     
    PJ, Jun 25, 2003
    #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. Matt
    Replies:
    3
    Views:
    509
    Tor Iver Wilhelmsen
    Sep 17, 2004
  2. asd
    Replies:
    3
    Views:
    440
    Arnaud Berger
    May 23, 2005
  3. gavnosis
    Replies:
    0
    Views:
    523
    gavnosis
    Aug 2, 2003
  4. th3dude
    Replies:
    0
    Views:
    433
    th3dude
    Jan 3, 2007
  5. engwar
    Replies:
    2
    Views:
    740
    Peter Flynn
    Nov 5, 2007
Loading...

Share This Page