SQLServerCentral Article

Methods for Parsing XML files

,

Methods for Parsing XML files
     As we all know, in coding, there are many ways to get the same job done. In my experimentation with XML,

I have run across many instances where this scenario is clearly true. Although some methods are grossly

better than others, they all have a place in our programming repertoire depending on the circumstance.

Take a look at some examples.


This example uses the selectSingleNode method to access the value of each node.
This example uses the getElementsByTagName method to create a node list for each node

name group. Then parses the xml file by iterating through each node list.

This example uses the getElementsByTagName method to create a 'parent' node list, then accesses

each child node based on its index.

This example uses the getElementsByTagName method to create a 'parent' node list, then

iterates through its child nodes and returns the node value and name.



For additional articles, please feel free to visit my homepage.

Have questions, email me at [email protected]

Rate

1 (1)

You rated this post out of 5. Change rating

Share

Share

Rate

1 (1)

You rated this post out of 5. Change rating