MSXML 2.0 DLL

22
MSXML 2.0 DLL • DOM 1.0 Element: getElementsByTagName, getAttribu te, getAttributeNode NamedNodeMap: getNamedItem, SetNamedItem, removeNamedItem, item, length parseError Object Node: AddElement, Addattribute,appendchil d InsertElementBefore, ReplaceChild, remo veChild, createAttribute SelectNodes, SelectSingleNode, Nodefromid

description

MSXML 2.0 DLL. DOM 1.0 Element: getElementsByTagName, getAttribute, getAttributeNode NamedNodeMap: getNamedItem, SetNamedItem, removeNamedItem, item, length parseError Object Node: AddElement, Addattribute,appendchild InsertElementBefore, ReplaceChild, removeChild, createAttribute - PowerPoint PPT Presentation

Transcript of MSXML 2.0 DLL

Page 1: MSXML 2.0 DLL

MSXML 2.0 DLL

• DOM 1.0• Element: getElementsByTagName, getAttribute, getAttrib

uteNode• NamedNodeMap: getNamedItem, SetNamedItem, remove

NamedItem, item, length• parseError Object• Node: AddElement, Addattribute,appendchild InsertEleme

ntBefore, ReplaceChild, removeChild, createAttribute• SelectNodes, SelectSingleNode, Nodefromid

Page 2: MSXML 2.0 DLL

MSXML 2.0 DLL

• XSLT: TransformNode, TransformNodetoObject• xmlhttpRequest: Get, Post XML file

Page 3: MSXML 2.0 DLL

MSXML 3.0 DLL

• MSXML 3.0 Supports Xpath 1.0, XSLT 1.0, XDR, and SAX2

• XSLT: XSLTemplate30 to create cached Stylesheet to increase the performance, CreateCachedStylesheet, input, output, addparameter, addObject

• http://msdn.microsoft.com/library/periodic/period00/xml0900.htm

Page 4: MSXML 2.0 DLL

MSXML 3.0 DLL-XSLT

<xsl:transform version=“1.0” xmlns:xsl=http://www.w3.org/1999/xsl/transform xmlns:mylib=“urn:mylib”>

<xsl:template match=“/”> Message: <Xsl:value-of select=“mylib:GetMessage()”/> Time: <xsl:value-of selec=“mylib:get-time()”/> </xsl:template> <xsl:transform>

Set obj = createObject(“mylib.myobject”)Processor.addobject obj, “urn:mylib”Processor.Transform

Page 5: MSXML 2.0 DLL

MSXML 3.0 DLL-XPath

• Doc.setProperty "SelectionLanguage", "XPath“, ixmlDomSelection

• Dim sel as ixmlxmldomselection sel=doc.selectnodes(“child::bar/*”) sel.clone,matches,context,expr,getproperty,peeknode, removeAll, removeNext

Page 6: MSXML 2.0 DLL

MSXML 3.0 DLL-SAX

• SAX(simple API for XML): startDocument, startElement, characters, endElement, endDocument

Page 7: MSXML 2.0 DLL

MSXML 3.0 DLL-XDR

• XDR: XML-Data Reduced Dim cache as IXMLDOMschemaCollection Set Cache = new XMLschemaCache30 Cache.add “urn:bar”, xdrdom Doc1.schemas = cache Doc1.load “foo.xml” Doc1.vallidate

Page 8: MSXML 2.0 DLL

MICROSOFT ACTIVEX DATA OBJECTS 2.5 LIBRARY

• Recordset.open

• Recordset.save Response, adPersistXML

• Recordset.save “xxx.xml”, adPersistXML

• Recordset.save ST, adPersistXML

• Recordset.open ST

Page 9: MSXML 2.0 DLL

MICROSOFT ACTIVEX DATA OBJECTS 2.5 LIBRARY

• ADODB.STREAM Public Function GetEmployees()

dim ostrm dim rs dim objGetEmployees set objGetEmployees = Server.CreateObject( “HRApp.CempMgr”) set rs = objGetEmployees.getEmployees()Set oStrm=server.createObject( “ADODB.Stream”)Ostrm.openRs.save ostrm,1Ostrm.position=0GetEmployees=oStrm.ReadTextGetEmployees=oStrem.ReadTextSet oStrm=nothingSet rs=nothingSet objGetEmployees=NOTHINGEnd Function

Page 10: MSXML 2.0 DLL

MICROSOFT ACTIVEX DATA OBJECTS 2.5 LIBRARY

Private Function XML2RS(sXML as string) as adodb.recordset

Dim oStrm as ADODB.Stream

Set oStrm = new Stream

Set XML2RS = new ADODB.Recordset

oStrm.open

oStrm.WriteText sXML

oStrm.Position = 0

XML2RS.Open oStrm

Set oStrm = nothing

End Function

Page 11: MSXML 2.0 DLL

SOAP TOOLKIT WIZARD

• ASP:Create an ASP file and an SDL file in XML format. ASP+SDL+Listener in the same Web folder

• ISAPI: Create an ASP file and an Sod file. (<? Xml version=“1.0” ?>

• <SOD progID=“progamID.ClassID” schemaLoc=“f:\Web\Class.xml”/

> )

Page 12: MSXML 2.0 DLL
Page 13: MSXML 2.0 DLL
Page 14: MSXML 2.0 DLL

<serviceDescription name='SoapDest' xmlns='urn:schemas-xmlsoap-org:sdl.2000-01-25'

xmlns:dt='http://www.w3.org/1999/XMLSchema' xmlns:CStringTest='CStringTest' >

<import namespace='CStringTest' location='#CStringTest'/>

<soap xmlns='urn:schemas-xmlsoap-org:soap-sdl-2000-01-25'>

<interface name='CStringTest'>

<requestResponse name='StringReverse'>

<request ref='CStringTest:StringReverse'/>

<response ref='CStringTest:StringReverseResponse'/>

<parameterorder>sText</parameterorder>

</requestResponse>

</interface>

<service>

<addresses>

<address uri='http://localhost/CStringTest.asp'/>

</addresses>

<implements name='CStringTest'/>

</service>

</soap>

Page 15: MSXML 2.0 DLL

<CStringTest:schema id='CStringTest' targetNamespace='CStringTest' xmlns='http://www.w3.org/1999/XMLSchema'>

<element name='StringReverse'>

<type>

<element name='sText' type='dt:string'/>

</type>

</element>

<element name='StringReverseResponse'>

<type>

<element name='return' type='dt:string'/>

<element name='sText' type='dt:string'/>

</type>

</element>

</CStringTest:schema>

Page 16: MSXML 2.0 DLL

<%@ Language=VBScript%>

<% Option Explicit

Response.Expires = 0

Const SOAP_SDLURI = "http://localhost/CStringTest.xml" 'URI of service description file

Const MSDNSOAP_SDL = "MSDNSOAP_CStringTest" 'Application Variable name for caching SDL %>

<!--#include file="listener.asp"-->

<%Public Function StringReverse (ByRef sText)

Dim objStringReverse

Set objStringReverse = Server.CreateObject("SoapDest.CStringTest")

StringReverse = objStringReverse.StringReverse(sText)

'Insert additional code here

Set objStringReverse = NOTHING

End Function%>

Page 17: MSXML 2.0 DLL

SOAP TOOLKIT :ASP• Soap RequestListener.asp Load class.xml (sdl) c

all class.asp call sub method in class.asp actual methodlistener.asp use response.write sends the result back

Page 18: MSXML 2.0 DLL

SOAP TOOLKIT: ISAPI

Page 19: MSXML 2.0 DLL

ROPE(Remote Object Proxy Engine) 1.0 TYPE LIBRARY : proxy

• Proxy: Wrapper class for use by client Set objProxy = New ROPE.Proxy objProxy.LoadServicesDescription(icURI, "http://192.168.1.1/Inventory.xml")

objProxy.getTitlePrice(“Rocking Chair”)

Page 20: MSXML 2.0 DLL

ROPE 1.0 TYPE LIBRARY : SOAPPackager

• SOAPPackager: Creates SOAP messages. Serializes and deserializes parameters

 .LoadServicesDescription getmethodname,getParameter

Public Function GetEmployeesXML()

dim objgetEmployeesXML

set objgetEmployeesXML= Server.CreateObject( _

“HRApp.CEmpMgr”)

GetEmployeesXML=

objGetEmployeesXML.GetEmployeesXML()

Dim oPkgr

Set oPkgr=Server.CreateObject(“ROPE.SOAPPackager”)

GetEmployeesXML= oPkgr.Cdataize(GetEmployeesXML)

set oPkgr=nothing

set objGetEmployeesXML= Nothing

End function

Page 21: MSXML 2.0 DLL

• WireTransfer: POSTS HTTP requests. Sets and gets HTTP headers.

oWire=CREATEOBJECT("Rope.WireTransfer")

oXML=oWire.GetPageByURI("http://www.digi.com/rr.xml")

Page 22: MSXML 2.0 DLL