Web Services, Part IX: Pattern-Based XML Node Selection - Doc JavaScript | WebReference

Web Services, Part IX: Pattern-Based XML Node Selection - Doc JavaScript


Web Services, Part IX: Pattern-Based XML Node Selection

In this column we continue our series on Web services. In Part I, we introduced you to this hot topic. In Part II, we showed you how to call Web services. In Part III, we presented the WebService behavior and its four supported methods. In Part IV, we continued our coverage of the WebService behavior by describing its objects and properties. In Part V, we dove into XML and XSLT. In Part VI, we started a miniseries on how to load and manipulate XML files from JavaScript. We continued this miniseries in Part VII, where we focused on the DOMDocument's nodes and node types. In Part VIII, we examined the world of document type definitions (DTDs). In this column, we turn your attention to techniques for finding nodes on the tree.

So far, we have showed you in our columns how to load an XML file into a DOMDocument tree structure. Once data is stored, you need to be able to extract it efficiently and easily. In this column, we'll show you how to fetch nodes by using search patterns. You can always start at the root and navigate the tree, but this algorithm may be too long. We'll show you in this column how to find nodes much faster and easier. We'll teach you the concept of context and how to use it. We'll show you how to select nodes with the selectNodes() and selectSingleNode() methods.

In this column you will learn:

You can find a listing of our XML, XSL, and DTD files in Column 103, or you can download them directly from this zipped file.

Next: How to define context - Part A

http://www.internet.com


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: February 25, 2002
Revised: February 25, 2002

URL: http://www.webreference.com/js/column104/index.html