Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Define an empty node in XML.

Status
Not open for further replies.

zhshqzyc

Programmer
Jan 21, 2006
13
US
Hello,

May I define an empty node in a XML file then do something?
The following is vb.net code.
Code:
Dim ReasonNodeList As Xml.XmlNodeList = SomeNode.SelectNodes("./REASON_CODE/REASON")
I mean there is no such a node ./REASON_CODE
 
Empty node is not the same as non-existing node (your "no such node"). The XmlNodeList instance just gives you .Count=0. You can, in this sense, do "something" with it. It is not a runtime error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top