Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to get xml node with a specified value ?

How to get xml node with a specified value ?

Scheduled Pinned Locked Moved C#
xmltutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    taibc
    wrote on last edited by
    #1

    Hi everyone, I have xml string like this:

    <content>
    <person>

      <firstname>Peter</firstname>
      <lastname>John</lastname>
    

    </person>
    <person>

      <firstname>Tom</firstname>
      <lastname>Crui</lastname>
    

    </person>
    <person>

      <firstname>Holse</firstname>
      <lastname>Moul</lastname>
    

    </person>

    </content>

    Now I want to get the node that has value: Tom Do you know how can do that (I don't want to use a for/foreach statement to check) Thanks and regards, Tai

    V 1 Reply Last reply
    0
    • T taibc

      Hi everyone, I have xml string like this:

      <content>
      <person>

        <firstname>Peter</firstname>
        <lastname>John</lastname>
      

      </person>
      <person>

        <firstname>Tom</firstname>
        <lastname>Crui</lastname>
      

      </person>
      <person>

        <firstname>Holse</firstname>
        <lastname>Moul</lastname>
      

      </person>

      </content>

      Now I want to get the node that has value: Tom Do you know how can do that (I don't want to use a for/foreach statement to check) Thanks and regards, Tai

      V Offline
      V Offline
      vonb
      wrote on last edited by
      #2

      Look here http://msdn.microsoft.com/it-it/library/bb387053.aspx[^] Hope it helps..

      The signature is in building process.. Please wait...

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups