Feb 18, 2008

Node tree

When XSLT processor read a xml document, it generates a node tree. The nodes can be one of the following.

  • Element Nodes
  • Attribute Nodes
  • Text nodes
  • Comment nodes
  • Processing-instruction nodes

Attribute nodes are a bit special because attributes are not contained in elements in the same way as other elements or text, but they are still associated with particular elements. the element that an attribute is associated with is still known as its parent, but attributes are not their parent element's children, just its attributes.

Other models of XML documents, such as the Document Object Model and the XML Infoset, aslo view XML documents as tree structures, although the models are just slightly different form the node tree that XSLT uses.