How to Select XML Type Sub-Nodes in ASP
XML nodes in ASP.NET can be thought of as a tree of information that fall into a hierarchy. In ASP.NET they can be rendered as a Node Tree. The Node Tree consists of Ancestor Nodes, Root Nodes, Parent Nodes, and Child Nodes. Parent nodes may be called nodes and Child Nodes may be called sub-nodes in other scripting sites. It is possible to select sub-nodes from an XML file and turn those into ASP.NET script by using the DOM, or Document Object Model for your ASP.NET site.
Instructions
-
-
1
Use the XMLDocument object to upload your XML file into the Document Object Model on your ASP.NET site. Find this through the file server at System.xml. Once you upload the XML file, it will now be called "XML Document" on the DOM system.
-
2
Open XML Document and type in the function "Dim EmployeeList as XmlNodeList
EmployeeList = XMLDocument.SelectNodes("/parentnode/childnode")" at the bottom of the node list. This is the Select Nodes() function; it will allow you to select all of the sub-nodes of a single node list. Insert the name of the node where it says "parentnode" and the name of the group of sub-nodes where it says "childnode."This will create an XMLNodeList.
-
-
3
Save the XMLNodeList. Run this list in ASP.NET to view an ASP script of the selected XML sub-nodes.
-
1
References
- Photo Credit Jason Reed/Photodisc/Getty Images