include 和 import 都可以啊!看看xslt的spec,有例子的。

解决方案 »

  1.   

    sample : <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:import href="article.xsl"/>
      <xsl:import href="bigfont.xsl"/>
      <xsl:attribute-set name="note-style">
        <xsl:attribute name="font-style">italic</xsl:attribute>
      </xsl:attribute-set>
    </xsl:stylesheet>URL : 
    http://www.w3.org/TR/xslt#section-Combining-Stylesheets
      

  2.   

    不是一个意思吧,你回答的是如何把两个xsl文件合起来一起去展示xml吧,但我要求的是用另外一个xsl去解析已有的xsl,就像用xsl去解析xml一样。比如两个xsl文件:start.xsl和generate_html.xslstart.xsl
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     version="1.0">
    <xsl:output/><xsl:template match="/">
     <page title="XSLT Through Generation">
     <xsl:for-each select="products/product">
     <para>
     <link href="{@href}"><xsl:value-of select="name"/></link>
     </para>
     </xsl:for-each>
     </page>
    </xsl:template></xsl:stylesheet>generate_html.xsl
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     version="1.0"><xsl:template match="xsl:output">
     <xsl:copy>
     <xsl:attribute name="method">html</xsl:attribute>
     </xsl:copy>
    </xsl:template><xsl:template match="page">
     <html>
     <head><title><xsl:value-of select="@title"/></title></head>
     <body>
     <h1><xsl:value-of select="@title"/></h1>
     <xsl:apply-templates/>
     </body>
     </html>
    </xsl:template><xsl:template match="para">
     <p><xsl:apply-templates/></p>
    </xsl:template><xsl:template match="link">
     <a href="{@href}"><xsl:apply-templates/></a>
    </xsl:template><xsl:template match="@*|node()">
     <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
     </xsl:copy>
    </xsl:template></xsl:stylesheet>用generate_html.xsl解析start.xsl,怎么做,谢谢!
      

  3.   

    按照你的xsl,应该是有个product的xml首先用start.xsl进行transform再用generate_html.xsl进行transform。或者你先将start.xsl用generate_html.xsl进行transform也可以。至于如何做,跟你的编程环境有关(比如java),跟xsl本身无关。
      

  4.   

    xsl本身也是xml文件,你怎么解析xml文件就怎么解析xsl文件呗。