only for RuBoard |
xsl:include includes the referenced XSLT stylesheet. It allows stylesheets to be combined without changing the semantics of the stylesheets being combined. Including a stylesheet is the same as importing a stylesheet using xsl:include , except that xsl:import causes the including stylesheet to override the included stylesheet.
Attribute Name | Enforced | Description | Values |
---|---|---|---|
href | Required | The location of the XSLT stylesheet to include | URI Reference |
Given the following XML instance document, links.xml ,
<links> <link name="NewRiders.com" URL="http://www.newriders.com" /> <link name="Xmlandasp.net" URL="http://www.xmlandasp.net" /> <link name="MSDN Online Library" URL="http://msdn.microsoft.com/library" /> </links>
The following stylesheet, links.xsl , includes the referenced stylesheet, styles.xsl.
links.xsl <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="styles.xsl" /> <xsl:template match="/"> <table> <xsl:apply-templates /> </table> </xsl:template> </xsl:stylesheet> styles.xsl <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="links/link"> <tr> <td> <xsl:value-of select="@name" /> </td> </tr> </xsl:template> </xsl:stylesheet>
This imports all the template rules and definitions from styles.xsl . The following markup is generated. Notice that the table element was generated from links.xsl and the table rows and cells were generated from styles.xsl :
<?xml version="1.0" encoding="UTF-16"?> <table> <tr><td>NewRiders.com</td></tr> <tr><td>Xmlandasp.net</td></tr> <tr><td>DevX.com</td></tr> </table>
xsl:stylesheet or xsl:transform
None.
only for RuBoard |