VB.NET: Searching Through The XML Nodes On Conditional Attribute Value
Searching in the XML file to get a particular node with an attribute of the given value is sometimes quite confusing.
April 19, 2005
Searching in the XML file to get a particular node with an attribute of the given value is sometimes quite confusing.
Here is a simple generic function to solve that problem.
It takes the following parameters:
xelRootNode: in most cases, I pass the documentElement, but if you want to search inside a particular node, pass that.
strAttribName: The name of the attribute to be checked.
strAttribValue: The attribute value to be matched.
xelResultNode: Byref, to return the node found
strSearchNodesBaseName: Optional, if the search is to be done in nodes of any particular name.
Hope this will be useful for generic purposes.
Read more about:
MicrosoftAbout the Author
You May Also Like