Freigeben über


XML Developer Center Lanches on MSDN

I have been silent on my blog for a while mainly due to getting an article written for the XML Developer Center that launched today at https://msdn.microsoft.com/xml/. The article is an overview of the best features of the core XML classes in the System.Xml V2 release. Many people on the Webdata XML team said that they were amazed by how much had been done in the V2 release after reading this and this is only half the story. The other half is returning XML from SQL Server relational tables and the XML support inside SQL Server “Yukon”, now called SQL Server 2005 to enable those data publishing scenarios.

What I would like to hear are comments on is how these features may affect development projects that you are working on today or in the future. For example it is difficult to assess what impact XQuery is going to have on the industry. Some people look at XQuery simply as an alternative to some XSLT scenarios, whilst others see the rich function and operators support being crucial with XQuery as a better XPath language. What are your top 10 XML requests?

As with any article you have to cut some topics from the list. Here are the top four that nearly made it;

  1.  The XSD Inference API. Instance schema generation based upon real world XML documents which can then be refined through iteratively. More useful than an XML Schema designer.
  2. XPathDocument implements IXmlSerializable which means that it can be used as the return type for a web service method. No more String types in order to return XML. Now it can be a real document
  3. Many methods and properties on the XmlReader, XmlWriter and XPathNavigator abstract classes now have default implementations added making it easier to implement your custom versions over datastores. For example all the new CLR type accessors methods have default implementations meaning that you do not have to implement them yourself.
  4. XPathNodeIterator implements the IEnumerable interface. Now you can just 'foreach' over a selected set of nodes rather than having to call the MoveNext() method in a while loop (well I showed this, just did not say this explicitly!). E.g.

    XPathDocument doc = new XPathDocument(filename);
    XPathNodeIterator nodes= doc.Select("//Customers");
foreach (XPathNavigator node in nodes)

    {

    //...do work here

        Console.WriteLine(node.Name);
}

Comments

  • Anonymous
    March 29, 2004
    You wrote:
    > a side note, the SqlConnection class in
    > ADO.NET also supports the "using" keyword in
    > V2.0 on the .NET Framework, which closes the
    > connection

    I can also do this with v1.1. I've just checked with Reflector, and Dispose() is definately being called.

    > Many methods and properties on the
    > XmlReader, XmlWriter and XPathNavigator
    > abstract classes now have default
    > implementations

    Fantastic! I can throw away all my abstract classes whose sole purpose is to provide default implementations for all this stuff.


    > This expression is first compiled by the
    > Compile method, which does type checking on > the values and generates an executable

    Is this a memory leak in .Net code? The Microsoft CLR is unable to unload assemblies from a running AppDomain - hence multiple compilations of XQuery expressions will use progressively more and more RAM eventually causing either the process to exit on exception, or for it to be recycled in the case of ASP.Net. I guess the same can be said for the new XSLT engine.

    > This new XSLT processor is called the
    > XsltCommand class and lives in the
    > System.Xml.Query namespace

    This is really really going to confuse people. An XSLT processor which is not in the XSL namespace? Pit of success? Not!


    Overall, the perf improvements make me wish .Net v2 was a 2004 release, not a 2005 release. Well Done!
  • Anonymous
    March 30, 2004
    Your article link doesn't actually link to
    the article.
  • Anonymous
    March 31, 2004
    Answer:
    Not at all until after they are released.

    And then not until all our corporate customers can be convinced to move to whichever Windows Server 200x supports them.

    I've given up reading 'a first look' material after I wasted lots of time reading 'a first look' material about Hailstorm.
  • Anonymous
    April 13, 2004
    Has anyone ever made a request to Microsoft to provide some kind of parameterized query support for XPath or XQuery? One of the things that has always concerned me, as XML support becomes more and more powerful, is the similarity with an ad-hoc XPath or XQuery expression with SQL Injection. Although the relative danger of such a problem is minimal, it can be the result of buggy code. XSL stylesheets support $name named variables in XPath queries, so I think it might be worthwhile to be able to append parameters to an XPathExpression or XQuery similar to adding @Name parameters in ADO.NET to a Command object.

    Just some food for thought.

  • Anonymous
    April 14, 2004
    We already support parameterized XPath, but you have to use the XPathExpression object and jump through a lot of hoops. For XQuery, parameter support will be first class, no hoops, very similar to our XSLT story.
  • Anonymous
    April 22, 2004
    I want to hear more about the implementation of IXmlSerializable. You mentioned that XPathDocument implements it and I know the ObjectSet also implements it. What other classes implement IXmlSerializable? Also, I would like to know about a lightweight way of taking a serialized objectset and mapping it to relational tables. If I had the osd/rsd mapping files is there a class that "applies" this diffgram to the datastore without the overhead of creating the objects.
  • Anonymous
    April 26, 2004
    The DataSet is the classic class that implement IXmlSerializable so that it can be marshalled as XML over a webservice. The DataTable has also joined the DataSet in implementing IXmlSerializable which makes this much more lightweight for relational data.

    The implementation in the XPathDocument is to call the Load() and Save() method since the store is already XML.

    Objectspaces is a lightweight object persistence format to relational data in that it examines the changes performed on the object and generates the necessary SQL commands to update the SQL Server database. It does not send all the data in the wire. In other words it does change tracking on each user defined object.
  • Anonymous
    May 25, 2004
    I was looking forward for this all the time
  • Anonymous
    June 01, 2004
    Good Work..
  • Anonymous
    June 22, 2004
    interesting and useful
  • Anonymous
    June 26, 2004
    good work
  • Anonymous
    May 29, 2009
    PingBack from http://paidsurveyshub.info/story.php?title=mark-fussell-s-weblog-xml-developer-center-lanches-on-msdn