2012-10-07 127 views
3

我是xml和xslt中的新成員。如何將xslt 1.0升級到xslt 2.0?

我使用經典的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> 

IM我的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?

回答