Ziff-Davis Enterprise 
DevSource: Microsoft Developer Resource
Add OnsArchitectureLanguagesTechniquesUsing VSForums
 
Home arrow Using VS arrow X Marks The Spot
X Marks The Spot
By Lynn Greiner

Rate This Article:
Add This Article To:
The next version of Visual Studio will have major improvements in its XML capabilities. Lynn Greiner outlines the new features, and what they'll mean to you.

Everyone knows the rules of a treasure hunt: X marks the spot. A big red X on a map, a cunningly carved X on a tree, even a landmark that, when, seen from above, is shaped like an X. They point the way to wonders.

In Visual Studio 2005, X marks the spot where you'll find some shiny new tools — XML, that is.

ADVERTISEMENT

In Visual Studio 2001 and 2003, XML editing tools were rudimentary at best. Although XML was supported, and the System.Xml namespace was provided and integrated with ADO.NET, you can't really say that XML was more than bolted onto the products.

With Visual Studio 2005, it appears, XML has truly arrived.

According to Neetu Rajpal, Microsoft's program manager for XML technologies, Visual Studio 2005 has a for-real XML editor which will contain the following functionality:

  • Design time well-formedness and validation errors
  • Validation support for Schema, DTD, and XDR
  • Inferring an XSD Schema from an XML instance
  • Converting a DTD or XDR to XSD Schema
  • Context and namespace-sensitive Intellisense
  • Element completion
  • XSLT editing, viewing the results of the transform
  • Standard Visual Studio code editing, including standard editor keys, outlining and commenting or un-commenting

Since there's no such thing as perfect code the first time, you get a proper XSLT debugger as well, with a set of functions one has grown to expect in Visual Studio:

  • Invoking the debugger from the XML editor
  • The ability to set and remove breakpoints
  • Standard Visual Studio debugger function key and menu bindings (F9 for setting/removing breakpoints, for example)
  • Viewing the output of the transform as it is being generated
  • Locals, Watch and Call stack windows
  • Stepping into the XSLT from a C# (or any other CLR language) program

Poke deeper in the treasure chest buried under the X. You'll find that you get a genuine XML editor and XSLT debugger. Plus, your XSLT is now compiled, not interpreted as it was in .NET v1.0. XSLT stylesheets compile to CLR MSIL (Microsoft Intermediate Language) in .NET v2.0, improving performance, according to Microsoft, by 400 percent. Rajpal says that XmlReader and XmlWriter double in speed, and schema validation is 20% faster under v2.

System.Xml, the namespace in the .NET Framework containing classes that let you build XML support into applications, has been polished up, too. Version 2, aside from being faster (see above), has been tweaked to allow programmers to do more in fewer lines of code.

It also conforms to the XML 1.0 standard by default. For example, in v1.0, XmlTextReader had no DTD support and was unable to resolve entity references in documents. In v2.0, this has been corrected.

As well, classes have been made type aware to accommodate support for XQuery.

Xquery is a relatively new query language introduced by the W3C, for which the rationale is described by the group thusly: "a query language that uses the structure of XML intelligently can express queries across all kinds of data, whether physically stored in XML or viewed as XML via middleware. ... XQuery is designed to be broadly applicable across many types of XML data sources."

Microsoft's Mark Fussell describes it more concisely: "The XQuery language is to XML as the SQL language is to relational databases." In fact, he says, it is set to become the universal query language for data interpretation.

XQuery, says Fussell, was designed to provide the following:

  • A greater expressiveness with the ability to perform complex query operations such as joins, ordering and sorting
  • A human-friendly, non-XML syntax (it actually reads a lot like SQL)
  • Strong typing at both compile time and runtime.
  • A rich set of functions and operators to operate on XML Schema types.

Need more info? You'll find XQuery as part of Visual Studio 2005 Beta 1, which can be found at http://lab.msdn.microsoft.com/vs2005/. For additional data on XML in Visual Studio, visit http://msdn.microsoft.com/xml.




Discuss X Marks The Spot
 
>>> Be the FIRST to comment on this article!
 

 
 
>>> More Using VS Articles          >>> More By Lynn Greiner
 



DevSource video
Devsource Video Series
Manipulating Society through Technology
Jeremy Bailenson, Director of the Virtual Human Interaction Lab at Stanford University, talks about virtual reality, avatars, Moore's law, how real world behaviors influence online reality, and societal manipulation through technology!
>> Play video
>> Read article
>> See all videos
DevLife Blog

Julia explores the Robotics Studio! (It's for more than you think.)

MSDev Blog

Messages for Bill Gates!

Make it Work
.NET makes runtime type checking a breeze. See what Peter has to say about it in this week's tips!
News
Microsoft Counts on App Support for Vista
Microsoft has taken pains to demonstrate that Windows Vista will have ample application support.
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.