spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column102


Web Services, Part VII: XML Object's Nodes and Types

Lead Test Engineer
The Computer Merchant, Ltd
US-SC-Charleston

Justtechjobs.com Post A Job | Post A Resume
Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs


Legal Parents and Possible Children

The DOMDocument object can be described as a tree (see Page 2 of our last column for an example). The entities of the tree are called nodes. There are twelve node types in DOMDocument. The following table lists them. For each node, you can also find in this table which node types can be its parent, and which types can be its children.

Value1
DescriptionAn element
nodeTypeString"element"
Can have child nodes of type:Element, Text, Comment, ProcessingInstruction, CDATASection, and EntityReference
Can be a child node of type:Document, DocumentFragment, EntityReference, and Element
Value2
DescriptionAn attribute
nodeTypeString"attribute"
Can have child nodes of type:Text and EntityReference
Can be a child node of type:none
Value3
DescriptionThe text content of a tag
nodeTypeString"text"
Can have child nodes of type:none
Can be a child node of type:Attribute, DocumentFragment, Element, and EntityReference
Value4
DescriptionA CDATA section. The XML parser should consider the section as text only.
nodeTypeString"cdatasection"
Can have child nodes of type:none
Can be a child node of type:DocumentFragment, EntityReference, and Element
Value5
DescriptionAn entity reference
nodeTypeString"entityreference"
Can have child nodes of type:Element, ProcessingInstruction, Comment, Text, CDATASection, and EntityReference
Can be a child node of type:Attribute, DocumentFragment, Element, and EntityReference
Value6
DescriptionAn expanded entity
nodeTypeString"entity"
Can have child nodes of type:Any node included in an expanded entity. For example: Text and EntityReference
Can be a child node of type:DocumentType
Value7
DescriptionA processing instruction
nodeTypeString"processinginstruction"
Can have child nodes of type:none
Can be a child node of type:Document, DocumentFragment, Element, and EntityReferenceDocumentType
Value8
DescriptionA comment
nodeTypeString"comment"
Can have child nodes of type:none
Can be a child node of type:Document, DocumentFragment, Element, and EntityReference
Value9
DescriptionA document object. As the root of the document tree, provides access to the entire XML document. It is created using the progID "Microsoft.XMLDOM" or through a data island using <XML> or <SCRIPT LANGUAGE=XML>.
nodeTypeString"document"
Can have child nodes of type:Element (maximum of one), ProcessingInstruction, Comment, and DocumentType
Can be a child node of type:none
Value10
DescriptionThe document type, as indicated by the <!DOCTYPE>.
nodeTypeString"documenttype"
Can have child nodes of type:Notation and Entity
Can be a child node of type:Document
Value11
DescriptionA document fragment
nodeTypeString"documentfragment"
Can have child nodes of type:Notation and Entity
Can be a child node of type:Document
Value12
DescriptionA document type's notation
nodeTypeString"notation"
Can have child nodes of type:any
Can be a child node of type:DocumentType

Next: How to set the node name

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


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

URL: http://www.webreference.com/js/column102/2.html