Presentation is loading. Please wait.

Presentation is loading. Please wait.

DAT 379 XML Today And Tomorrow Mark Fussell Lead Program Manager Microsoft Corporation.

Similar presentations


Presentation on theme: "DAT 379 XML Today And Tomorrow Mark Fussell Lead Program Manager Microsoft Corporation."— Presentation transcript:

1 DAT 379 XML Today And Tomorrow Mark Fussell Lead Program Manager Microsoft Corporation

2 The Zen of XML XML Origami A understanding of XML is inescapable

3 XML Programming In.NET Today V1.1 Themes Standards compliance UsabilityExtensibility Integration with ADO.NET Tomorrow V2.0 Themes PerformanceUsability Querying over XML documents and SQL Server with ADO.NET XML Tools in Visual Studio

4 XML I/O Scenarios Today Streaming XML Reading XML from file, http, or other source Use the XmlTextReader for parsing XML Fast, Forward-only cursor XmlValidatingReader – Schema Validating Writing XML Use the XmlTextWriter for writing XML Fast, forward-only streaming writer Use the XmlTextReader and XmlTextWriter in combination Simple transformations

5 XML I/O Scenarios Tomorrow Reading XML from file, http or other source Usability – Typed and untyped XML. CLR types from XML Usability – Static Create methods Pipelining and layering functionality Security – DoS and resource access authorization Writing XML Typed and untyped XML – From CLR types to XML Wellformedness checking when writing to file Easier implementation of custom XmlReaders and XmlWriters More methods and properties have default implementatons on XmlReader class

6 Usability CLR Type Accessors On XmlReader, XmlWriter and XPathNavigator Double price = XmlConvert.ToDouble(reader.ReadElementString()); //Replaced by Double price = reader.ReadValueAsDouble; On the XmlWriter DateTime publicationdate = new DateTime(2004,5,24); writer.WriteStartAttribute("publicationdate");writer.WriteValue(publicationdate);writer.WriteEndAttribute();

7 Usability Static Create Methods Prevent a proliferation of XmlReader and XmlWriter implementations XmlReaderSettings and XmlWriterSettings classes Optimizations depending on the settings Pipelining XmlReaderSettings settings = new XmlReaderSettings(); settings.Schemas.Add(“books.xsd"); settings.XsdValidate = true; XmlReader reader = XmlReader.Create(“books.xml”, settings ); while(!reader.Read()) { }

8 XmlReader and XmlWriter

9 Document Scenarios Today XML Stores Creating and editing documents Use the XmlDocument class (XML DOM) Querying and transforming XML XSLT Path 1.0 Applying business logic Events to determine what has changed XML over a webservice Use the XmlNode class

10 Document Scenarios Tomorrow Creating and editing documents Consistent editing API with XmlWriter Typed XML store with Validation support Richer querying and transformation XSLT and XQuery Applying business logic XML documents over a Web service Moving XML between components more easily

11 XPathDocument A Better XML DOM The XPathDocument replaces the XmlDocument as the primary XML store Feature Set 20%-40% more performant for XSLT and XQuery Editing capabilities through the XPathEditableNavigator using an XmlWriter XML schema validation Strongly typed store with schema; e.g., Integers stored as CLR int type Events fired for insert, update, and delete Change tracking support

12 Working with the XPathDocument versus the XmlDocument

13 System.Xml Today (V1.1) XslTransform XmlReader XmlWriter XmlDocumentXPathDocument XPathNavigator XmlSchemaCollection

14 XPathEditableNavigator XsltCommandXQueryCommand XmlWriter XmlWriterSettings XPathNavigator XPathDocumentXmlDocument XmlSchemaSet XmlReader XmlReaderSettings XmlSchemaSet System.Xml Tomorrow (V2)

15 Querying Scenarios Today Querying XPath 1.0 to select nodes within an XML document Use XPathNavigator and Select() methods Transforming XML Transforming XML XML schema to XML schema HTML document generation Use XsltTransform class

16 Querying Scenarios Tomorrow Querying XQuery is to XML as SQL is to relational databases XQuery includes XPath 1.0 and 2.0 and more… Has a friendlier syntax Strongly-typed Construction of XML Ability to do joins across documents Comprehensive set of functions and operators Use XQueryCommand class Transforming XML Compiled XSLT with the XsltCommand class Generates MSIL Debugging XSLT

17 XQuery: The Essentials As simple as XPath… Get all the customers from the context document /customers FLWOR — FOR/LET/WHERE/ORDER BY/RETURN Yet much more powerful… Get all the customers and for each customer list their order amounts joining across two documents for $cust in doc (‘customers’)//customer return { for $order in doc (‘orders’)//order where ($cust/id = $order/custid) return { $order/@amount} } for $cust in doc (‘customers’)//customer return { for $order in doc (‘orders’)//order where ($cust/id = $order/custid) return { $order/@amount} }

18 Querying XML With XQuery

19 Performance Improvements XML parsing and XSLT performance XML schema validation 20% faster XmlTextReader 100% faster (2x) XmlTextWriter 100% faster (2x) XSLT 4x faster

20 XML Tools In Visual Studio 2005 XML Editing, XML Schema generation, and XSLT Debugging

21 Summary Today the XML support in.NET provides the ability to easily work with any XML that you encounter Tomorrow there are many improvements to address usability, querying, performance and XML tools within Visual Studio 2005

22 Find me in the Community Lounge mfussell@microsoft.com MSDN XML Developer Center http://msdn.microsoft.com/xml/ What's New in System.Xml for Visual Studio 2005 and the.NET Framework 2.0 Release What's New in System.Xml for Visual Studio 2005 and the.NET Framework 2.0 ReleaseNewsgroups microsoft.public.dotnet.xml for V1 microsoft.beta.whidbey.xml for V2

23 Related Sessions Thursday DATPNL Data Access Round Table. 11:45 AM- 12:30 PM, Room 8 DAT319 XML in the Database - the XML Data Type in SQL Server 2005 (code named "Yukon"). 1:30 PM- 2:45 PM, Room 5AB DAT376 What's New in ADO.NET for Visual Studio 2005 (code named "Whidbey"). 5:30 PM- 6:45 PM, Room 5AB Friday DAT327 SQL Server 2005 (code named "Yukon"): Inside XQuery. 2:45 PM- 4:00 PM, Room 9

24 Q1:Overall satisfaction with the session Q2:Usefulness of the information Q3:Presenter’s knowledge of the subject Q4:Presenter’s presentation skills Q5:Effectiveness of the presentation Please fill out a session evaluation on CommNet

25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "DAT 379 XML Today And Tomorrow Mark Fussell Lead Program Manager Microsoft Corporation."

Similar presentations


Ads by Google