XPath

   

Combining Style Sheets

Two solutions to combine two or more style sheets are available: inclusion or importing. Style sheet inclusion, through xsl:include , appends the templates of the included style sheet in the current style sheet. If a template is defined in both style sheets, a duplicate definition results:

 <xsl:include href="common.xsl"/> 

Importing is more sophisticated. Similar to inclusion, it appends templates from the imported style sheet in the current one. However, the current style sheet can redefine some (or all, although it is less useful) of the imported templates. The redefined templates take precedence over the imported ones:

 <xsl:import href="common.xsl"/> 

Templates that override imported templates can call the original definition with xsl: apply-imports :

 <xsl:template match="Title">       <FONT COLOR="black">          <xsl:apply-imports/>       </FONT>    </xsl:template> 
   


Applied XML Solutions
Applied XML Solutions
ISBN: 0672320541
EAN: 2147483647
Year: 1999
Pages: 142

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