VB 9.0 Xml in Visual Studio "Orcas" February CTP

In February CTP you will find the same functionality as in the May CTP with many improvements. Some of these improvements came from the feedback of extensive usability studies we conducted in the fall. Observing the obstacles users encountered provided us with good ideas on how to improve the Xml integration features. Some of these ideas are already included in this CTP and we are currently working on others. We also improved substantially the quality of the implementation with the help of our excellent test team who wrote comprehensive automated tests suites.

You will find the following improvements in the February CTP compare with the May 2006 CTP:

Attribute axis property is string

The attribute axis property type has changed to string. We realized that the common use case of accessing an attribute is to get its value. In very few cases people are interested to get back the attribute object itself. So we changed the attribute axis property to return the string value, the LINQ to XML API "Attribute" method can be used to return the actual XAttribute object.

We haven't change the element and the descendants axis return type, since with this axis there are important scenarios where it is ambiguous whether the intent to return the IEnumerable of the elements with the specified name or the string value of the first element. Thus with these axes the return type remains IEnumerable of the elements with that name, and the "Value" extension property will return the string value of the first element.

Here is an example for the Xml axis properties with the new semantics for the Attribute property:

Dim book = <book>

             <author name="David">



             <author name="Erik">




For Each author In book.<author>

     Console.WriteLine(author.@name & "  " & author.<origin>.Value)



Global Xml namespace syntax has changed

We slightly changed the syntax of the global Xml namespaces to be wrapped in angle brackets. For example:

'CLR namepsaces

Imports System

'Xml namespaces

Imports <xmlns:ns="http://myNamepsace/com">


Added auto-completion

To the list of "auto" functionalities (correction, outlining), we added the "auto-completion" of tags such as elements, embedded expressions, comments, PI and CData sections. For embedded expression the VB intellisense shows up immediately after typing the "=" character.


Xml names are VB symbols

All of the Xml names used in the VB program are treated as symbols similar to the way VB treats the names of CLR variables. This allowed us to add support for finding all references to a specific name, enable go to the definition of the namespace prefix and also to rename namespace prefix or the local name of element or attribute.  


Improved error handling    

We added many error messages for common errors we saw in the usability studies. We created a special error for the case of comparing IEnumerable(of XElement) and string so if the user forgets to use the "Value" property when comparing the element property to string an error message provides guideline for how to fix it. Consider the following example:

If a.<b> = "fff" Then

End If   

This will provide the following compile time error: "Overload resolution failed because no accessible '=' can be called with these arguments: 'Public Shared Operator =(a As String, b As String) As Boolean': Cannot convert 'IEnumerable(Of XElement)' to 'String'. You can use the 'Value' property to get the string value of the first element of 'IEnumerable(Of XElement)'.


These are some of the improvements in the February CTP, we are not done yet (hint :), but I hope you will enjoy programming Xml in VB9 with this CTP, as always feedback is always welcome.


Avner Aharoni

Comments (6)

  1. I’m eagerly looking forward to the next (February/March?) CTP of Orcas. The XML team has just annouced…

  2. Los equipos de desarrollo de Microsoft, ultiman la próxima versión de Microsoft .NET Framework, están

  3. The Community Technology Preview of the next version of the .NET components that the XML team ships is

  4. Lately I’ve been playing around with embedded DSLs for Java. Regular readers might remember my little

  5. .NET Alapok says:

    A Lurdy házban tartott május 24-ei MSDN bemutató alatt vetette fel az egyik előadó félkomolyan, hogy

  6. My latest posts on DSLs caused a bit of a stir around the blogosphere. Some of of the more constructive

Skip to main content