330 likes | 487 Views
MSXML In-Depth Features: Current And Future Charlie Heinemann Program Manager XML Core Services Microsoft Corporation 9-326. MSXML in 2000. What’s available today? What’s available tomorrow? What’s on the horizon?. MSXML in Windows 2000. MSXML2 in SQL Server 2000. MSXML3 on the Web.
E N D
MSXML In-Depth Features: Current And FutureCharlie HeinemannProgram ManagerXML Core ServicesMicrosoft Corporation 9-326
MSXML in 2000 • What’s available today? • What’s available tomorrow? • What’s on the horizon? MSXML in Windows 2000 MSXML2 in SQL Server 2000 MSXML3 on the Web
MSXML in Windows 2000 • XML 1.0 • Namespace 1.0 • DOM 1.0 (Document Object Model) • Schema (Validation) • XSL (Transformations) • XSL Pattern (Querying) • XMLHTTP (Posting and Getting XML) • XML Data Source Object • IE 5 XML Support
MSXML in Production • Microsoft.com • Document Management • Document Interchange • 200,000 – 2 million hits/day
MSXML2: Performance • Advanced XML Interfaces • In-line Schemas • General Performance Enhancements • Improved Scalability
Advanced XML API’s • XSL Interfaces • XSLTemplate Interface • XSLProcessor Interface • DOMSelection Interface • SchemaCollection Interface
XSL Interfaces • Passing parameters to stylesheets • Passing objects to stylesheets • Caching stylesheets
Demo Part 1 • XSLT Transform • Passing Parameters • Passing Objects
XSL Interfaces: Passing Parameters xslprocessor.addParameter(“color”, “red”) . . . <xsl:param name=“color”/> <xsl:template name=“BodyTemplate”> <tr style="color:{$color}"> … </tr> </xsl:template>
XSL Interfaces: Passing Objects myObj.numberValue = .15 xslproc.addObject(myObj, "urn:my-percent-object") … <xsl:stylesheet xmlns:perObj=“urn:my-percent-object” …> <xsl:template match="price"> <xsl:value-of select="."/> @ <xsl:value-of select="perObj:get-percent()"/> discount </xsl:template>
DOMSelection Interface • Querying the DOM using Xpath xmldoc.setProperty(“SelectionLanguage”, “XPath”) domsel = xmldoc.selectNodes(“//child::*”) • Returns an DOMSelection Object • Inherits from IXMLDOMNodeList • Added functionality for managing result sets returned from a query • Caching queries • Compile the XPath expression once • Programmatically set multiple contexts
SchemaCollection Interface • Caching schemas to improve performance • Validating XML against external schemas • Validating XML at run-time
Demo Part 2 • In-line Schema Support • Validating against external schemas • Re-applying the schema cache
In-Line Schema Support <root xmlns:foo=“x-schema:#mySchema”> <Schema name=“mySchema” xmlns=“urn:schemas-microsoft-com:xml-data”> <ElementType name=“bar”/> </Schema> <foo:bar>Hello World</foo:bar> </root>
SchemaCollection Interface: Creating a Schema Cache cache = new ActiveXObject(“MSXML2.XMLSchemaCache"); cache.add("myFooURI", "http://server/xmldataschema1.xml"); cache.add("uri3", myDomDocument); xmldoc.schemas = cache; xmdoc.load("http://myserver/mydata.xml");
SchemaCollection Interface: Applying the Schema Cache cache.add(“urn:book-ns”, schemaDoc) xmldoc.schemas = cache xmldoc.load(“xmlfile.xml”) newNode = xmldoc.createElement(“pub”) docEl = xmldoc.documentElement docEl.appendChild(newNode) xmldoc.validate()
General Performance Enhancements • XSLT Transformations • Up to 3x Improvement over MSXML • Querying the DOM • Walking the DOM • Plug in MSXML2 and improve performance of old scenarios
Improved Scalability • 100% increase in scaling • Greatest increase in 4+ procs • See http://msdn.microsoft.com/xml/articles/xml03202000.asp for numbers and scenarios
MSXML3: Standards • Full XSLT Support • Full XPath Support • SAX (Simple API for XML) • Finishing touches on XML 1.0
XSLT/XPath Support • XSLT • Full compliance • Script Blocks • XPath • Full compliance • SelectNodes Support
Demo Part 3 • XPath Querying • XPath support in the DOM - selectNodes
SAX2 • Low-level Parser Interfaces • Event-driven parser • Parsing w/o building a DOM tree • Needed for messaging and other high-throughput scenarios • Needed for processing large documents • Currently available for C++ programmers - VB interfaces coming soon
Demo Part 4 • SAXXMLReader • SAX in VB
Event-driven Parser Private Sub ISAXContentHandler_StartElement( NamespaceURI, LocalName, RawName, Attributes) If LocalName = “Book” Then Debug.Print "Book Data Present" End If End Sub
Full XML 1.0 Compliance • Put the finishing touches on 1.0 compliance • Full Namespace 1.0 compliance
Advanced XMLDSO Support • Better integration with ADO • Binding Flat XML to Controls using ADO 2.5 • Binding Complex XML to Hierarchical Controls using ADO 2.6
Demo Part 5 • XML Data Source Object • Displaying XML in Excel
Binding XML to Grid Controls CN.Provider = “MSDAOSP” CN.Properties(“DataSource”) = “MSXML2.DSOControl” CN.Open RS.Open “http://server/simple.xml”, CN Set DataGrid1.DataSource = RS
Conclusion MSXML in Production Now MSXML2 – new Performance-enhancing XML API’s, additional schema work, general performance improvements MSXML3 – Standards Release: Full XSLT and XPath support, SAX2, Full XML 1.0 Compliance XML
Resources and Services • XML Developer Center http://msdn.microsoft.com/xml • SOAP Toolkit http://msdn.microsoft.com/xml/general/ toolkit_intro.asp • SQL Server 2000 Beta http://www.microsoft.com/SQL/productinfo/ sql2kord.htm • Biztalk Server 2000 Technical Preview http://www.microsoft.com/biztalkserver/ techres/techpreview.asp
Call to Action • Download the latest MSXML release (MSXML3) • Visit the XML Developer Center and check out the new materials there • Start prototyping and developing applications using XML technologies