我对XML和XSLT比较陌生。
我使用经典的ASP进行网页编程,使用Windows平台进行网页制作,本地计算机的ID是“localhost/mywebpage”。
今天我尝试使用XSLT运行一个XML文件,但是出现了错误。
msxml3.dll error '80004005'
Keyword xsl:template may not contain xsl:for-each-group.
以下是我的运行代码。
在 XML 中:
<Lakes>
<Lake>
<id>1</id>
<Name>Caspian</Name>
<Type>Natyral</Type>
</Lake>
<Lake>
<id>2</id>
<Name>Moreo</Name>
<Type>Glacial</Type>
</Lake>
<Lake>
<id>3</id>
<Name>Sina</Name>
<Type>Artificial</Type>
</Lake>
</Lakes>
在 XSLT(XSLT 2.0)中
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each-group select="Lakes/Lake" group-by="Type">
<xsl:result-document href="file{position()}.xml">
<Lakes>
<xsl:copy-of select="current-group()"/>
</Lakes>
</xsl:result-document>
</xsl:for-each-group>
</xsl:template>
</xsl:stylesheet>
在我的ASP页面中
<%
'load xml
set xml = server.createobject("microsoft.xmldom")
xml.async = false
xml.load(server.mappath("test.xml"))
'load xsl
set xsl = server.createobject("microsoft.xmldom")
xsl.async = false
xsl.load(server.mappath("test.xsl"))
set xdm= server.createobject("msxml2.domdocument")
xdm.async = false
xdm.loadxml(xml.transformnode(xsl))
xdm.save(server.mappath("test_r.xml"))
%>
我需要升级我的XSLT1.0到XSLT2.0,应该做什么?