xsl:include

only for RuBoard

xsl:include

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.

Attributes

Attribute Name

Enforced

Description

Values

href

Required

The location of the XSLT stylesheet to include

URI Reference

Example

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> 

Parent Elements

 xsl:stylesheet or xsl:transform 

Child Elements

None.

only for RuBoard


XML and ASP. NET
XML and ASP.NET
ISBN: B000H2MXOM
EAN: N/A
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net