Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

XML Integration

Back to Forum: Tech Off
  • User profile image
    wkempf

    I've watched the VB 9.0 video, and the XML integration into the language as a known type is, I think, a good idea.  E4X has done this for ECMA (Java)Script, and certainly makes working with XML a whole lot easier than it is today with DOM APIs.  As much as I like it, I do see the arguments from the other side.  It definately adds complexity to the language.  In ECMA Script, the complexity is offset by the simplifications brought to something that nearly every single script is going to deal with.  In other languages, you may not use XML as much, if at all, depending on your particular needs.  Granted, the "industry" is pushing us to use more and more XML, but many developers rightfully question whether or not that's a good idea.

    But leaving that behind, I deal with a significant amount of XML in my own world, and with XAML and other such technologies I'll just be dealing with it more and more in the future.  The idea of having an "XML type" in the language is, therefore, a very appealing idea.  Unfortunately (or fortunately, depending on how you want to look at it), I don't use VB.  I use C#.  I'm not going to switch to using VB.  From what I read about C# 3.0, there's no current plans to do the same for my preferred language.

    So, my question is, has this been considered?  Is there a reason why XML integration hasn't been proposed for C# 3.0?  Is there any chance that it will be prior to the actual release?

    Honestly, this is an idea that's at least as exciting as LINQ is.  The two combined would drastically improve the code and the productivity for me.

  • User profile image
    TommyCarlier

    I think it has been considered (I think COmega has this?), but either rejected or not yet implemented.
    Since you talk about LINQ, you probably know that you can use XElement, like this:

    var x =
       new XElement("person",
          new XAttribute("firstname", "John"),
          new XAttribute("lastname", "Doe"),
          new XElement("email", "john@doe.com"));

    Which results in this XML element:

    <person firstname="John" lastname="Doe">
       <email>john@doe.com</email>
    </person>

    It's not really the same, but it's a lot better than the XML DOM functionality in .NET 2.0.

  • User profile image
    wkempf

    TommyCarlier wrote:

    I think it has been considered (I think COmega has this?), but either rejected or not yet implemented.
    Since you talk about LINQ, you probably know that you can use XElement, like this:

    var x =
       new XElement("person",
          new XAttribute("firstname", "John"),
          new XAttribute("lastname", "Doe"),
          new XElement("email", "john@doe.com"));

    Which results in this XML element:

    <person firstname="John" lastname="Doe">
       <email>john@doe.com</email>
    </person>

    It's not really the same, but it's a lot better than the XML DOM functionality in .NET 2.0.



    Yes, that alternative was shown in the VB video, but as you say, though better than the current DOM APIs, this is a far cry from the elegance of the integrated syntax.  I'd really like to see the integration in C#.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.