简体   繁体   中英

How can I find the corresponding node in xml using Vb.net

This is my xml. I have Id 1490. How can I find the corresponding node in xml using Vb.net I can't use LINQ

    <Abc>
     <A> 
      <Name>T</Name>
      <Id>1232</Id>
      <Val>140</Val>
      <Branch>
       <A>
       <Name>T.1</Name>
      <Id>1343</Id>
      <Val>14qw0</Val>
       </A>
       <A>
       <Name>T.2</Name>
      <Id>1090</Id>
      <Val>14qwd0</Val>
       <Branch>
       <A>
       <Name>T.2.2</Name>
        <Id>1490</Id>
        <Val>rt56</Val>
       </A>
       </Branch>
     </A>
</Branch>
     </A>
     <A>
       <Name>TA</Name>
        <Id>1339</Id>
        <Val>uiui</Val>
        <Branch>
        <A>
        <Name>TA.1</Name>
            <Id>1338</Id>
            <Val>bije</Val>
        </A>
        </Branch>
    </A>
    </Abc>

You can use the selectNodes with the XmlDocument. Follow this link: http://msdn.microsoft.com/en-us/library/Aa335969

A vb.net example can be seen here, with loading the xml string in a document, and then selecting nodes: http://www.daniweb.com/software-development/v.net/threads/349552/getting-single-node-by-id-then-get-childnode-innertext

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM