<% ' Apply the given XSL style sheet to the XML document, and show the result Sub ApplyXSL( xmlURL, xslURL) dim doc dim style dim result ' XML Document set doc = Server.CreateObject("Microsoft.XMLDOM") doc.load(xmlURL) ' XSL style sheet set style = Server.CreateObject("Microsoft.XMLDOM") style.load(xslURL) ' Apply the style sheet result = doc.transformNode(style.documentElement) ' Write the resultant, tranformed XML (probably now HTML) response.write(result) End Sub ' Pinched from MIND Sept 99 Function AddXMLNode( DOMXML, Parent, Name, Value) dim objNode set objNode = DOMXML.createNode (1, Name,"") if len(Value) <> 0 then objNode.text = value end if Parent.appendChild objNode set addXMLNode = objNode end function ' Remove the numbered node from the XML document - dodgy Sub RemoveXMLNodeID (DOMXML, NodeID) RemoveXMLNode doc, doc.documentElement.childNodes.Item(NodeID) end sub ' Remove the given node from the XML document Sub RemoveXMLNode (Node) dim parent set parent = Node.parentNode parent.removeChild(Node) end sub ' Create a new node and insert it before it Sibling Function InsertXMLNode (DOMXML, Sibling, Name, Value) dim parent set parent = Sibling.parentNode dim objNode set objNode = DOMXML.createNode (1, Name,"") if len(Value) <> 0 then objNode.text = value end if parent.insertBefore objNode, Sibling set InsertXMLNode = objNode end function ' Replace the first Name d node with the new value function ReplaceXMLNode (DOMXML, Name, Value) dim oldNode set oldNode = DOMXML.SelectSingleNode("//" & Name) dim objNode if oldNode is nothing then ' Do nothing set objNode = Nothing else dim parent set parent = oldNode.parentNode set objNode = DOMXML.createNode (1, Name,"") if len(Value) <> 0 then objNode.text = value end if parent.replaceChild objNode, oldNode end if set ReplaceXMLNode = objNode End function ' Save the given XML DOM to a file Sub SaveXML (DOMXML, Filename) ' Use the File System Object dim objFSO set objFSO = Server.CreateObject("Scripting.FileSystemObject") ' Create a new text file with given name dim objTStream set objTStream = objFSO.CreateTextFile( Filename, true, false) ' Write out the XML objTStream.write DOMXML.xml ' Close objTStream.close set objFSO = nothing end sub %>