xsl:import

only for RuBoard

xsl:import

xsl:import imports the referenced XSLT stylesheet. Any template rules in the stylesheet take precendence over the included template rules.

Attributes

Attribute Name

Enforced

Description

Values

href

Required

The location of the XSLT stylesheet to import

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 selects the node list containing all link nodes. Each iteration applies the local template that outputs the name attribute and the <br/> tag:

 <?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="/">            <xsl:apply-templates/>         </xsl:template>  </xsl:stylesheet> 

This stylesheet imports template rules from style.xsl , as shown here:

 <?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 . Furthermore, if a template rule for the root context is provided, the current template rule overrides it.

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