Home > SOA Tips > .NET Developer > .NET tools for working with XML
SOA Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

.NET DEVELOPER

.NET tools for working with XML


Peter G. Aitken
06.01.2004
Rating: -3.33- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


A lot of people associate the .NET framework with XML, and for good reason. .NET uses XML behind the scenes to implement many of its development tools, such as SOAP and Web services. Beyond that, however, .NET provides a powerful set of classes for working with XML directly. Whatever you need to do with XML—sequential or random access, validation, transforms, or output—the .NET Framework provides you with tools that are not only powerful but easy to use.

This article from InformIT provides an overview of the most important of these classes. All of .NET's XML classes are in the System.XML namespace, and support the following standards (listed with their WWW namespaces):

XmlTextReader
The XmlTextReader class provides non-cached, forward-only access to a stream of XML data. It is designed specifically for fast access to XML data while placing minimal demands on the system's resources. Functionally, XmlTextReader is similar to the Simple API for XML (SAX), another technique for reading XML that is popular with non-.NET programmers.

XmlValidatingReader
The XmlValidatingReader class, as its name implies, provides data validation capabilities. Specifically, it can validate XML data against a document type definition (DTD), an XML schema definition language (XSD) schema, or an XML Data Reduced (XDR) schema. This class does not work alone; it must be used in conjunction with an instance of XmlTextReader that is passed to the constructor. Thus, this class gives you the forward-only capabilities of XmlTextReader with validation added. XmlValidatingReader also adds support for default attributes and the ability to resolve external references. Validation of XML data is an inherently complex and slow process.

XmlDocument
The XmlDocument class implements the W3C Document Object Model (DOM) core levels 1 and 2. This class provides random, cached access to the XML data. In other words, the data is held in memory and your program can move forward and backward as needed. Actually, "forward" and "backward" are not really accurate, because the DOM represents XML data as a tree of nodes, so what you are really doing is "walking the tree." The XmlDocument class also permits you to modify the document's data and structure.

Other Classes in System.XML
We've looked at three of the most important XML-related .Net classes, but there are many more that cannot be covered here. For example, the XmlTextWriter class lets you create XML output that conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations. And the XslTransform class transforms XML data using an XSLT stylesheet.

XML is becoming increasingly important as a data storage and transfer standard in many areas of information technology. With the tools provided by the .NET Framework, you should be able to handle essentially any XML-related programming task.


Click over to InformIT to read the original article which includes more in-depth descriptions of the above classes as well as examples.


Rate this Tip
To rate tips, you must be a member of SearchSOA.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
SOA security tools
Some Eclipse SOA Tools Projects are archived as work on SCA, modeling, moves ahead
CA adds federated security to fight growing threats to SOA
Faster SOA testing drives iTKO Eclipse release
Weak encryption creates SOA vulnerabilities
SOA tools hit UML tipping point
Eclipse Ganymede: Rich Ajax Platform focuses on users
Eclipse Ganymede Part 1: What's in it for SOA?
SOA picture worth 1,000 words for HP
SOA remaking business analyst job
OpenID: Leveraging a widely accepted identity Web service

Platforms and Servers
Tracking down managed memory leaks
Handling exceptions in .NET
.NET Compact Framework graphics
The Data Access Application Block
Decision time: .NET or J2EE?
A great .NET resource: .Net2TheMax
Delegates vs. interfaces in .NET
Project structure best practices
Working with PDFs in a .NET environment
Displaying errors with the error provider

.NET Developer
Programming Indigo
DataSets and Web services don't mix
Security in .NET 2.0
Tracking down managed memory leaks
Handling exceptions in .NET
.NET Compact Framework graphics
The Data Access Application Block
A great .NET resource: .Net2TheMax
Delegates vs. interfaces in .NET
Project structure best practices

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

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.



SOA Trends and Strategy - SOA Education, SOA Development, SOA Implementations
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts