OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Intrinsic Properties of XML Nodes

[ Lists Home | Date Index | Thread Index ]

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@hotmail.com
(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





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS