C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » General »

Document Object Model


Posted Date: 12 Jul 2004    Resource Type: Articles    Category: General
Author: Krishna Member Level: Silver    
Rating: 1 out of 5Points: 10



DOM (Document Object Model)

The Document Object Model (DOM) class is an in-memory representation of an XML document. The DOM allows you to programmatically read, manipulate, and modify an XML document.

The XmlReader class also reads XML, however it provides non-cached, forward-only, read-only access. This means that there are no capabilities to edit the values of an attribute or content of an element, or the ability to insert and remove nodes with the XmlReader. Editing is the primary function of the DOM. It is the common and structured way that XML data is represented in memory, although the actual XML data is stored in a linear fashion when in a file or coming in from another object.
In DOM, a XML document is represented as a Tree Structure.
Each circle in the above structure is known as a Node also known as XmlNode object.
The XmlNode object is the basic object in the DOM tree.
The XmlDocument class, which extends XmlNode
The XmlDocument class provides a means to view and manipulate the nodes in the entire XML document.

In the DOM structure(Tree structure), there are mainly 12 different types of XmlNodes, that can be categorized as

1. Nodes that can have child nodes,
2. Nodes that can’t have child nodes.

Nodes that can have child nodes are:

Document
DocumentFragment
EntityReference
Element
Attribute

Nodes that can’t have child nodes are:
XmlDeclaration
Notation
Entity
CDATASection
Text
Comment
ProcessingInstruction
DocumentType

The DOM is most useful for reading XML data into memory to change its structure, to add or remove nodes, or to modify the data held by a node as in the text contained by an element. However, other classes are available that are faster than the DOM in other scenarios. For fast, non-cached forward only stream access to XML, use the XmlReader and XmlWriter. If you need random access with a cursor model and XPath, use the XPathNavigator class.






Responses

Author: Hema Kumar    17 Jul 2004Member Level: Silver   Points : 0
Artical is very simple and easy to Understand.Keep it up.Come up with more articles


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Executing Commands
Previous Resource: Some Tips to imrove your UI #1
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use