[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Intrinsic Properties of XML Nodes

  • To: xml-dev@l...
  • Subject: Intrinsic Properties of XML Nodes
  • From: "James Cerra" <jc2astro@h...>
  • Date: Tue, 28 May 2002 17:18:20 -0400
  • Bcc:

counting xml nodes
Q: What intrinsic properties do the nodes of an XML document have in 
addition to those that are specified in the XML Infoset [1]?

A node (of type element, comment, text, processing instruction and root) of 
a XML document has the following properties by it's very nature of being a 
tree structure:

1) A parent node (unless it is a root node),
2) Zero or more child nodes (if it is a root or element node),
3) A level number (AKA layer in HTML),
4) A sibling number (based on the position among the node's siblings),

Furthermore, a node also has the following property because it is read 
sequentially as a text file:

5) A position in the order processed in the document.

In addition, several specs (XML Infoset [1] and DOM2 Core [2]) hint that a 
node can have several properties depending on the type:

6) Type of node
7) Name of node
8) Content of node
9) Attributes (if an Element)

Since nodes may be of different types, I think that there are a few more 
properties that may applicable:

10) A sibling number, counting only the same type of node.
11) A position in the order processed in the document, counting only the 
same type of node.
12) An XPointer representing the location of the node relative to a fixed 
position (I'm going to use the root node).

How complete is that list?  Are there any that I'm missing?

I am writing an XML processor as a module for an MathML processor, and I 
must create a flexible yet simple DOM for the project.  The DOM should 
easily support access to those properties that a node has by it's very 
nature, methinks.

Besides, I haven't read about a discussion about the properties of a node in 
a XML document as related to its data structure.

---
Jimmy Cerra
jc2astro@h...
(I use another private address for replies to control spam.)

---
"my mind is slipping away ... day by glorious day"
   -Robin Gorkin

---
Notes:
[1] http://www.w3.org/TR/xml-infoset/
[2] 
http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.