Visual Studio.NET and XML: A Bright Future

Learn what changes the Visual Studio.NET tools for working with XML in the .NET Framework will bring in how you work with XML in the Microsoft environment.

Woody Pewitt

January 2, 2001

3 Min Read
ITPro Today logo

Microsoft released Visual Studio.NET beta 1, and I read the documentation and tested the beta to see how this new development tool will change our lives. The .NET Framework, which is the infrastructure for the overall .NET platform, will be a major shift for how developers create applications. So far, everything looks good—I don't see any major part of the .NET Framework that doesn't use XML in some way. Although XML is overused in many places now, the .NET platform uses XML for good reason in beta 1.

Visual Studio.NET provides a new XML Designer tool for working with XML and XML schema definition (XSD) files. There are views for creating and editing XSD schemas, for doing structured editing of XML data files, and for editing XML source code. The XML Designer tool makes creating XSD documents almost as easy as laying out new tables in SQL Server 2000. Other than that, the XML Designer is a straightforward, color-coded text editor.

The .NET Framework contains several components you can use for working with XML. First, and most important, you can use any Document Object Model (DOM) code you create today in Visual Studio.NET. The Visual Studio.NET tools for working with XML in the .NET Framework aren't a radical departure from Microsoft XML Parser (MSXML), so you won't lose the time you spend with the MSXML 3.0 objects. The Common Language Runtime (CLR) lets you work with XML at many different levels, but the two lowest-level objects are the XmlReader and the XmlWriter. As the names imply, you use one object to read XML files and one to read and write XML files. The XmlReader object is a fast, forward-only cursor you can use for reading XML documents. XmlReader streams an XML document into memory. The XmlWriter object makes writing XML documents extremely easy, providing methods for you to create any constructs you need, such as WriteStartDocument, WriteStartElement, and WriteStartAttribute. This model is similar to the SAX helper classes. I found many other objects derived from the XmlReader and XmlWriter that help with XML document reading and processing.

There are some minor changes to the new XmlDocument object that are very similar to the XmlDocument that ships with MSXML 3.0. You can navigate documents with the XmlNavigator object, which is preferred for performance over the standard DOM methods. Most XmlNavigator implementations don't need to load the entire document into memory, but most DOM implementations do, making XmlNavigator a better-performing alternative. The XmlNavigator interface is also more intuitive than the DOM.

I hope you're hungry now to look at what's coming in the .NET platform. Using these tools to work with XML will be a major change in how you work with XML in the Microsoft environment.

Overall, the future looks so bright I have to wear shades!

Resources for More Information

.NET Platformhttp://www.microsoft.com/net.NET Frameworkhttp://msdn.microsoft.com/netXML in .NET: .NET Framework XML Classes and C# Offer Simple, Scalable Data Manipulation, by Aaron Skonnardhttp://msdn.microsoft.com/msdnmag/issues/01/01/xml/xml.asp

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like