MSXML in 2000

33
MSXML In-Depth MSXML In-Depth Features: Current And Features: Current And Future Future Charlie Heinemann Charlie Heinemann Program Manager Program Manager XML Core Services XML Core Services Microsoft Corporation Microsoft Corporation 9-326 9-326

description

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. - PowerPoint PPT Presentation

Transcript of MSXML in 2000

Page 1: MSXML in 2000

MSXML In-Depth Features: MSXML In-Depth Features: Current And FutureCurrent And Future

Charlie HeinemannCharlie HeinemannProgram ManagerProgram ManagerXML Core ServicesXML Core ServicesMicrosoft CorporationMicrosoft Corporation

9-3269-326

Page 2: MSXML in 2000
Page 3: MSXML in 2000

MSXML in 2000MSXML in 2000

What’s available today?What’s available today?

What’s available tomorrow?What’s available tomorrow?

What’s on the horizon?What’s on the horizon?

MSXML in Windows 2000

MSXML2 in SQL Server 2000

MSXML3 on the Web

Page 4: MSXML in 2000

MSXML in Windows 2000 MSXML in Windows 2000

XML 1.0 XML 1.0 Namespace 1.0 Namespace 1.0 DOM 1.0 (Document Object Model)DOM 1.0 (Document Object Model) Schema (Validation)Schema (Validation) XSL (Transformations)XSL (Transformations) XSL Pattern (Querying)XSL Pattern (Querying) XMLHTTP (Posting and Getting XML)XMLHTTP (Posting and Getting XML) XML Data Source Object XML Data Source Object IE 5 XML SupportIE 5 XML Support

Page 5: MSXML in 2000

MSXML in ProductionMSXML in Production

Microsoft.comMicrosoft.com Document ManagementDocument Management Document InterchangeDocument Interchange 200,000 – 2 million hits/day200,000 – 2 million hits/day

Page 6: MSXML in 2000

MSXML2: PerformanceMSXML2: Performance

Advanced XML InterfacesAdvanced XML Interfaces In-line SchemasIn-line Schemas General Performance General Performance

EnhancementsEnhancements Improved ScalabilityImproved Scalability

Page 7: MSXML in 2000

Advanced XML API’sAdvanced XML API’s

XSL InterfacesXSL Interfaces XSLTemplate InterfaceXSLTemplate Interface XSLProcessor InterfaceXSLProcessor Interface

DOMSelection InterfaceDOMSelection Interface SchemaCollection InterfaceSchemaCollection Interface

Page 8: MSXML in 2000

XSL InterfacesXSL Interfaces

Passing parameters to stylesheetsPassing parameters to stylesheets Passing objects to stylesheetsPassing objects to stylesheets Caching stylesheetsCaching stylesheets

Page 9: MSXML in 2000

Demo Part 1Demo Part 1

XSLT TransformXSLT Transform Passing ParametersPassing Parameters Passing ObjectsPassing Objects

Page 10: MSXML in 2000

XSL Interfaces: Passing XSL Interfaces: Passing ParametersParameters

xslprocessor.addParameter(“color”, “red”)xslprocessor.addParameter(“color”, “red”)

. . .. . .

<xsl:param name=“color”/><xsl:param name=“color”/>

<xsl:template name=“BodyTemplate”><xsl:template name=“BodyTemplate”>

<tr style="color:{$color}"><tr style="color:{$color}">

… …

</tr></tr>

</xsl:template></xsl:template>

Page 11: MSXML in 2000

XSL Interfaces: Passing XSL Interfaces: Passing ObjectsObjects

myObj.numberValue = .15myObj.numberValue = .15xslproc.addObject(myObj,xslproc.addObject(myObj, "urn:my-percent-object")"urn:my-percent-object")……<xsl:stylesheet <xsl:stylesheet

xmlns:perObj=“urn:my-percent-object” …>xmlns:perObj=“urn:my-percent-object” …><xsl:template match="price"><xsl:template match="price">

<xsl:value-of select="."/> @ <xsl:value-of select="."/> @ <xsl:value-of <xsl:value-of

select="perObj:get-percent()"/> select="perObj:get-percent()"/> discountdiscount

</xsl:template></xsl:template>

Page 12: MSXML in 2000

DOMSelection InterfaceDOMSelection Interface Querying the DOM using XpathQuerying the DOM using Xpathxmldoc.setProperty(“SelectionLanguage”, “XPath”)xmldoc.setProperty(“SelectionLanguage”, “XPath”)

domsel = xmldoc.selectNodes(“//child::*”)domsel = xmldoc.selectNodes(“//child::*”) Returns an DOMSelection ObjectReturns an DOMSelection Object

Inherits from IXMLDOMNodeList Inherits from IXMLDOMNodeList Added functionality for managing result sets Added functionality for managing result sets

returned from a queryreturned from a query Caching queriesCaching queries

Compile the XPath expression onceCompile the XPath expression once Programmatically set multiple contextsProgrammatically set multiple contexts

Page 13: MSXML in 2000

SchemaCollection InterfaceSchemaCollection Interface

Caching schemas to improve Caching schemas to improve performanceperformance

Validating XML against external Validating XML against external schemas schemas

Validating XML at run-timeValidating XML at run-time

Page 14: MSXML in 2000

Demo Part 2Demo Part 2

In-line Schema SupportIn-line Schema Support Validating against external schemasValidating against external schemas Re-applying the schema cacheRe-applying the schema cache

Page 15: MSXML in 2000

In-Line Schema SupportIn-Line Schema Support

<root xmlns:foo=“x-schema:#mySchema”><root xmlns:foo=“x-schema:#mySchema”>

<Schema name=“mySchema” <Schema name=“mySchema” xmlns=“urn:schemas-microsoft-com:xml-xmlns=“urn:schemas-microsoft-com:xml-data”>data”>

<ElementType name=“bar”/><ElementType name=“bar”/>

</Schema></Schema>

<foo:bar>Hello World</foo:bar><foo:bar>Hello World</foo:bar>

</root></root>

Page 16: MSXML in 2000

SchemaCollection Interface: SchemaCollection Interface: Creating a Schema CacheCreating a Schema Cachecache = new cache = new

ActiveXObject(“MSXML2.XMLSchemaCache");ActiveXObject(“MSXML2.XMLSchemaCache");

cache.add("myFooURI",cache.add("myFooURI",

"http://server/xmldataschema1.xml");"http://server/xmldataschema1.xml");

cache.add("uri3", myDomDocument);cache.add("uri3", myDomDocument);

xmldoc.schemas = cache;xmldoc.schemas = cache;

xmdoc.load("http://myserver/mydata.xml");xmdoc.load("http://myserver/mydata.xml");

Page 17: MSXML in 2000

SchemaCollection Interface: SchemaCollection Interface: Applying the Schema CacheApplying the Schema Cache

cache.add(“urn:book-ns”, schemaDoc)cache.add(“urn:book-ns”, schemaDoc)xmldoc.schemas = cachexmldoc.schemas = cachexmldoc.load(“xmlfile.xml”)xmldoc.load(“xmlfile.xml”)

newNode = xmldoc.createElement(“pub”)newNode = xmldoc.createElement(“pub”)docEl = xmldoc.documentElementdocEl = xmldoc.documentElementdocEl.appendChild(newNode)docEl.appendChild(newNode)

xmldoc.validate()xmldoc.validate()

Page 18: MSXML in 2000

General Performance General Performance EnhancementsEnhancements XSLT TransformationsXSLT Transformations

Up to 3x Improvement over MSXMLUp to 3x Improvement over MSXML Querying the DOMQuerying the DOM Walking the DOMWalking the DOM Plug in MSXML2 and improve Plug in MSXML2 and improve

performance of old scenariosperformance of old scenarios

Page 19: MSXML in 2000

Improved ScalabilityImproved Scalability

100% increase in scaling100% increase in scaling Greatest increase in 4+ procsGreatest increase in 4+ procs See See

http://msdn.microsoft.com/xml/articles/http://msdn.microsoft.com/xml/articles/xml03202000.aspxml03202000.asp

for numbers and scenariosfor numbers and scenarios

Page 20: MSXML in 2000

MSXML3: StandardsMSXML3: Standards

Full XSLT SupportFull XSLT Support Full XPath SupportFull XPath Support SAX (Simple API for XML)SAX (Simple API for XML) Finishing touches on XML 1.0Finishing touches on XML 1.0

Page 21: MSXML in 2000

XSLT/XPath SupportXSLT/XPath Support

XSLTXSLT Full compliance Full compliance Script BlocksScript Blocks

XPathXPath Full complianceFull compliance SelectNodes SupportSelectNodes Support

Page 22: MSXML in 2000

Demo Part 3Demo Part 3

XPath QueryingXPath Querying XPath support in the DOM - XPath support in the DOM -

selectNodesselectNodes

Page 23: MSXML in 2000

SAX2SAX2

Low-level Parser InterfacesLow-level Parser Interfaces Event-driven parserEvent-driven parser Parsing w/o building a DOM treeParsing w/o building a DOM tree Needed for messaging and other high-Needed for messaging and other high-

throughput scenariosthroughput scenarios Needed for processing large Needed for processing large

documentsdocuments Currently available for C++ Currently available for C++

programmers - VB interfaces programmers - VB interfaces coming sooncoming soon

Page 24: MSXML in 2000

Demo Part 4Demo Part 4

SAXXMLReaderSAXXMLReader SAX in VBSAX in VB

Page 25: MSXML in 2000

Event-driven ParserEvent-driven Parser

Private Sub ISAXContentHandler_StartElement( Private Sub ISAXContentHandler_StartElement(

NamespaceURI, LocalName, RawName, NamespaceURI, LocalName, RawName, Attributes)Attributes)

If LocalName = “Book” ThenIf LocalName = “Book” Then

Debug.Print "Book Data Present"Debug.Print "Book Data Present"

End IfEnd If

End SubEnd Sub

Page 26: MSXML in 2000

Full XML 1.0 ComplianceFull XML 1.0 Compliance

Put the finishing touches on 1.0 Put the finishing touches on 1.0 compliancecompliance

Full Namespace 1.0 complianceFull Namespace 1.0 compliance

Page 27: MSXML in 2000

Advanced XMLDSO SupportAdvanced XMLDSO Support

Better integration with ADOBetter integration with ADO Binding Flat XML to Controls using Binding Flat XML to Controls using

ADO 2.5ADO 2.5 Binding Complex XML to Binding Complex XML to

Hierarchical Controls using ADO 2.6Hierarchical Controls using ADO 2.6

Page 28: MSXML in 2000

Demo Part 5Demo Part 5

XML Data Source ObjectXML Data Source Object Displaying XML in ExcelDisplaying XML in Excel

Page 29: MSXML in 2000

Binding XML to Grid Binding XML to Grid ControlsControls

CN.Provider = “MSDAOSP”CN.Provider = “MSDAOSP”

CN.Properties(“DataSource”) = “MSXML2.DSOControl”CN.Properties(“DataSource”) = “MSXML2.DSOControl”

CN.OpenCN.Open

RS.Open “http://server/simple.xml”, CNRS.Open “http://server/simple.xml”, CN

Set DataGrid1.DataSource = RSSet DataGrid1.DataSource = RS

Page 30: MSXML in 2000

XML

ConclusionConclusion

MSXML in Production NowMSXML in Production Now MSXML2 – new Performance-MSXML2 – new Performance-

enhancing XML API’s, additional enhancing XML API’s, additional schema work, general performance schema work, general performance improvementsimprovements

MSXML3 – Standards Release: Full MSXML3 – Standards Release: Full XSLT and XPath support, SAX2, Full XSLT and XPath support, SAX2, Full XML 1.0 ComplianceXML 1.0 Compliance

Page 31: MSXML in 2000

Resources and ServicesResources and Services XML Developer CenterXML Developer Center

http://msdn.microsoft.com/xmlhttp://msdn.microsoft.com/xml SOAP ToolkitSOAP Toolkit

http://msdn.microsoft.com/xml/general/http://msdn.microsoft.com/xml/general/toolkit_intro.asptoolkit_intro.asp

SQL Server 2000 BetaSQL Server 2000 Betahttp://www.microsoft.com/SQL/productinfo/http://www.microsoft.com/SQL/productinfo/sql2kord.htmsql2kord.htm

Biztalk Server 2000 Technical PreviewBiztalk Server 2000 Technical Previewhttp://www.microsoft.com/biztalkserver/http://www.microsoft.com/biztalkserver/techres/techpreview.asptechres/techpreview.asp

Page 32: MSXML in 2000

Call to ActionCall to Action

Download the latest MSXML release Download the latest MSXML release (MSXML3)(MSXML3)

Visit the XML Developer Center and Visit the XML Developer Center and check out the new materials therecheck out the new materials there

Start prototyping and developing Start prototyping and developing applications using XML applications using XML technologiestechnologies

Page 33: MSXML in 2000