Function loadXMLFile(strXMLFile, strXSLFile)
'本地变量
Dim objXML
Dim objXSL
'初始化XMLDOM对象.
set objXML = Server.CreateObject("Microsoft.XMLDOM")
'关闭同步加载的文件.
objXML.async = false
'加载XML文件.
objXML.load(strXMLFile)
'初始化用于加载XSL文件的XMLDOM对象.
set objXSL = Server.CreateObject("Microsoft.XMLDOM")
'Turn off asyncronous file loading.
objXSL.async = false 'Load the XSL file.
objXSL.load(strXSLFile)
'Use the "transformNode" method of the XMLDOM to apply the
'XSL stylesheet to the XML document. Then the output is
'written to the client.
Response.Write(objXML.transformNode(objXSL))
End Function
这是在服务器转换的函数,
客户端的另外一种:
<SCRIPT LANGUAGE="JScript">
function window.onload()
{
divMenuToken.outerHTML = xmlMenuData.transformNode(xmlMenuStyle.documentElement);
}