MSXML 2 0 DLL DOM 1 0 Element






















- Slides: 22
MSXML 2. 0 DLL • DOM 1. 0 • Element: get. Elements. By. Tag. Name, get. Attribute. Node • Named. Node. Map: get. Named. Item, Set. Named. Item, remove. Named. Item, item, length • parse. Error Object • Node: Add. Element, Addattribute, appendchild Insert. Element. Before, Replace. Child, remove. Child, create. Attribute • Select. Nodes, Select. Single. Node, Nodefromid
MSXML 2. 0 DLL • XSLT: Transform. Node, Transform. Nodeto. Object • xmlhttp. Request: Get, Post XML file
MSXML 3. 0 DLL • MSXML 3. 0 Supports Xpath 1. 0, XSLT 1. 0, XDR, and SAX 2 • XSLT: XSLTemplate 30 to create cached Stylesheet to increase the performance, Create. Cached. Stylesheet, input, output, addparameter, add. Object • http: //msdn. microsoft. com/library/periodic/period 00/xml 0900. htm
MSXML 3. 0 DLL-XSLT <xsl: transform version=“ 1. 0” xmlns: xsl=http: //www. w 3. org/1999/xsl/transform xmlns: mylib=“urn: mylib”> <xsl: template match=“/”> Message: <Xsl: value-of select=“mylib: Get. Message()”/> Time: <xsl: value-of selec=“mylib: get-time()”/> </xsl: template> <xsl: transform> Set obj = create. Object(“mylib. myobject”) Processor. addobject obj, “urn: mylib” Processor. Transform
MSXML 3. 0 DLL-XPath • Doc. set. Property "Selection. Language", "XPath“, ixml. Dom. Selection • Dim sel as ixmlxmldomselection sel=doc. selectnodes(“child: : bar/*”) sel. clone, matches, context, expr, getproperty, peekno de, remove. All, remove. Next
MSXML 3. 0 DLL-SAX • SAX(simple API for XML): start. Document, start. Element, characters, end. Element, end. Document
MSXML 3. 0 DLL-XDR • XDR: XML-Data Reduced Dim cache as IXMLDOMschema. Collection Set Cache = new XMLschema. Cache 30 Cache. add “urn: bar”, xdrdom Doc 1. schemas = cache Doc 1. load “foo. xml” Doc 1. vallidate
MICROSOFT ACTIVEX DATA OBJECTS 2. 5 LIBRARY • • • Recordset. open Recordset. save Response, ad. Persist. XML Recordset. save “xxx. xml”, ad. Persist. XML Recordset. save ST, ad. Persist. XML Recordset. open ST
MICROSOFT ACTIVEX DATA OBJECTS 2. 5 LIBRARY • ADODB. STREAM Public Function Get. Employees() dim ostrm dim rs dim obj. Get. Employees set obj. Get. Employees = Server. Create. Object( “HRApp. Cemp. Mgr”) set rs = obj. Get. Employees. get. Employees() Set o. Strm=server. create. Object( “ADODB. Stream”) Ostrm. open Rs. save ostrm, 1 Ostrm. position=0 Get. Employees=o. Strm. Read. Text Get. Employees=o. Strem. Read. Text Set o. Strm=nothing Set rs=nothing Set obj. Get. Employees=NOTHING End Function
MICROSOFT ACTIVEX DATA OBJECTS 2. 5 LIBRARY Private Function XML 2 RS(s. XML as string) as adodb. recordset Dim o. Strm as ADODB. Stream Set o. Strm = new Stream Set XML 2 RS = new ADODB. Recordset o. Strm. open o. Strm. Write. Text s. XML o. Strm. Position = 0 XML 2 RS. Open o. Strm Set o. Strm = nothing End Function
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 prog. ID=“progam. ID. Class. ID” schema. Loc=“f: WebClass. xml”/> )
<service. Description name='Soap. Dest' xmlns='urn: schemas-xmlsoap-org: sdl. 2000 -01 -25' xmlns: dt='http: //www. w 3. org/1999/XMLSchema' xmlns: CString. Test='CString. Test' > <import namespace='CString. Test' location='#CString. Test'/> <soap xmlns='urn: schemas-xmlsoap-org: soap-sdl-2000 -01 -25'> <interface name='CString. Test'> <request. Response name='String. Reverse'> <request ref='CString. Test: String. Reverse'/> <response ref='CString. Test: String. Reverse. Response'/> <parameterorder>s. Text</parameterorder> </request. Response> </interface> <service> <addresses> <address uri='http: //localhost/CString. Test. asp'/> </addresses> <implements name='CString. Test'/> </service> </soap>
<CString. Test: schema id='CString. Test' target. Namespace='CString. Test' xmlns='http: //www. w 3. org/1999/XMLSchema'> <element name='String. Reverse'> <type> <element name='s. Text' type='dt: string'/> </type> </element> <element name='String. Reverse. Response'> <type> <element name='return' type='dt: string'/> <element name='s. Text' type='dt: string'/> </type> </element> </CString. Test: schema>
<%@ Language=VBScript%> <% Option Explicit Response. Expires = 0 Const SOAP_SDLURI = "http: //localhost/CString. Test. xml" description file Const MSDNSOAP_SDL = "MSDNSOAP_CString. Test" caching SDL %> 'URI of service 'Application Variable name for <!--#include file="listener. asp"--> <%Public Function String. Reverse (By. Ref s. Text) Dim obj. String. Reverse Set obj. String. Reverse = Server. Create. Object("Soap. Dest. CString. Test") String. Reverse = obj. String. Reverse(s. Text) 'Insert additional code here Set obj. String. Reverse = NOTHING End Function%>
SOAP TOOLKIT : ASP • Soap Request Listener. asp Load class. xml (sdl) call class. asp call sub method in class. asp actual method listener. asp use response. write sends the result back
SOAP TOOLKIT: ISAPI
ROPE(Remote Object Proxy Engine) 1. 0 TYPE LIBRARY : proxy • Proxy: Wrapper class for use by client Set obj. Proxy = New ROPE. Proxy obj. Proxy. Load. Services. Description(ic. URI, "http: //192. 168. 1. 1/Inventory. xml") obj. Proxy. get. Title. Price(“Rocking Chair”)
ROPE 1. 0 TYPE LIBRARY : SOAPPackager • SOAPPackager: Creates SOAP messages. Serializes and deserializes parameters . Load. Services. Description getmethodname, get. Parameter Public Function Get. Employees. XML() dim objget. Employees. XML set objget. Employees. XML= Server. Create. Object( _ “HRApp. CEmp. Mgr”) Get. Employees. XML= obj. Get. Employees. XML() Dim o. Pkgr Set o. Pkgr=Server. Create. Object(“ROPE. SOAPPackager”) Get. Employees. XML= o. Pkgr. Cdataize(Get. Employees. XML) set o. Pkgr=nothing set obj. Get. Employees. XML= Nothing End function
• Wire. Transfer: POSTS HTTP requests. Sets and gets HTTP headers. o. Wire=CREATEOBJECT("Rope. Wire. Transfer") o. XML=o. Wire. Get. Page. By. URI("http: //www. digi. com/rr. xml" )