Parsing
an xml file using asp can be done using the xmldom object. The xmldom
object has a lot of methods to work with an xml file. You can use these
methods to iterate through the nodes of an xml file and display the
data you get from it. You can also use an xsl file to display the data
in a formatted manner according to your requirement.
_______________________________________________
_______________________________________________
Once
you have created an xmldoc object you can use the selectNodes method
to select all the nodes that you want from the root node. For example
an xmlQuery like "//employees" that is passed to the selectNodes
method will get all the nodes of the employees. Assign the result that
you get out of the selectNodes command to a variable and find the length
of this variable.
This gives
the number of nodes you have in the xml file. Now iterate through the
nodes using a 'for' loop and use Response.Write to display the result.
Use the transformNode method to transform the data you get using an
xsl file to get formatted data.