How to check whether a node exists in an XML file?

Posted by kumar on Stack Overflow See other posts from Stack Overflow or by kumar
Published on 2009-03-17T04:16:56Z Indexed on 2010/05/07 9:48 UTC
Read the original article Hit count: 257

Filed under:

Hi

How can I check whether a node exists in an XML file, and also count the number of nodes.

I have one XML file for an example:

 <Employee>
  <Emp>
    <Name id="1">   A     </Name>
    <Name id="2">   C     </Name>
    <Name id="3">   D     </Name>
   </Emp>
  </Employee>

Thanks & Regards

Ravikumar

© Stack Overflow or respective owner

Related posts about Xml