DOM and .NET
Dale Michalk

The .NET Framework brings about a new paradigm of rapid-application development and cross-platform network integration. XML is a key enabling technology in this endeavor, and the framework uses it to full effect: configuration management, object serialization, remoting, Web services, database access, and file storage. The framework provides several APIs to work with the XML data: an in-memory DOM compliant interface, a streaming interface, and the XML functionality built into the DataSet. This tip, excerpted from

Requires Free Membership to View

InformIT discusses the structure of the Document Object Model API for XML information processing.

You can read the rest of this tip by clicking on (TK).

Got a developer tip of your own? Why not send it in? We'll post it on our Web site, and we'll enter you in our tips contest for some neat prizes.


The .NET Framework brings about a new paradigm of rapid-application development and cross-platform network integration. XML is a key enabling technology in this endeavor, and the framework uses it to full effect: configuration management, object serialization, remoting, Web services, database access and file storage. The framework provides several APIs to work with the XML data: an in-memory DOM compliant interface, a streaming interface, and the XML functionality built into the DataSet. This tip concentrates on the Document Object Model (DOM) API for XML information processing that most programmers have become accustomed to using with XML parsers such as MXSML.

The DOM models an XML document as a tree of nodes representing the information items of a document. A parser takes the serialized representation of the XML and creates an in-memory graph of nodes.

Each node in the document has a uniform interface to represent common functionality. The XmlNode takes on this responsibility in the .NET Framework by providing value, naming, navigation, and lifetime management of nodes in a document. The following list enumerates the base set of XmlNode properties for name and value acquisition.

Name
Value
NodeType
LocalName
Prefix
NamespaceURI
InnerXml
OuterXml

The OuterXml and InnerXml properties are Microsoft extensions that provide you with the capability to retrieve or set the XML content of a node or its child nodes, respectively, in a serialized form via a string parameter. They enable you to display node values easily or build complex document content quickly outside the node-construction methods discussed later in the article.

The NodeType property enables you to cast to the specific .NET class that a node represents.


To read the article from which this tip was excerpted, click over to InformIT. You have to register there, but it's free.

Did you like this tip? Email to let us know.


This was first published in October 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.