Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Methods for Parsing XML files

By Jon Winer, (first published: 2002/06/20)

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 jwiner1@cfl.rr.com
 
Total article views: 15321 | Views in the last 30 days: 2
 
Related Articles
ARTICLE

CLR Table-Valued Function Example with Full Streaming (STVF / TVF)

SQL CLR Table-Valued Functions can stream data back, but there aren't many examples of the quick and...

FORUM

Triggers Examples

Triggers Examples

ARTICLE

Optimizer Join Methods

Understanding the different types of joins used by the optimizer will help developers and DBAs under...

FORUM

Example SCD type 2

Example SCD type 2

ARTICLE

Exploring Recursive CTEs by Example

Recursive CTEs can be confusing and scary, so examining some non-standard examples may cast light up...

Tags
basics    
miscellaneous    
programming    
xml    
 
Contribute