Web Services, Part IX: Pattern-Based XML Node Selection: Context Definition (B) - Doc JavaScript | WebReference

Web Services, Part IX: Pattern-Based XML Node Selection: Context Definition (B) - Doc JavaScript


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

Context Definition - Part B

The fourth node of mydvd7.xml is where the data tree hangs. The name of the top-level child is sales (xmlDoc.childNodes[3].nodeName), from the sales tag:

<sales>
  .
  .
  .
</sales>

The sales node has two child nodes:

The summary node has five child nodes:

The summary's child nodes do not have any lower-level child nodes. The data node is the root of a much deeper tree, as it holds the actual data of the dvds. The data node has three child nodes, one for every month of the report:

Each month has five child nodes: one for its name and four for its four week proceeds. Here are the child nodes of January:

Similarly, here are the child nodes of February:

March's three child nodes are:

The name nodes have child nodes of their own, one per node. They hold the name's text property:


Next: How to select nodes

https://www.internet.com


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

URL: https://www.webreference.com/js/column104/3.html