Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2008, 07:43 AM
Authorized User
 
Join Date: Mar 2008
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default Including one xsl in another xsl

Hi,

I want to know how to include/import one xsl into another xsl. Here one general xsl contains all general processing works, say, "Generate_Response.xsl". It will be used from other two xsls, say, "Clinic.xsl" and "Hospital.xsl". Here how to call the templates present in the "Generate_Response.xsl" in "Clinic.xsl". Thanks in advance for your help.


 
Old March 31st, 2008, 07:58 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

There are two instructions, xsl:include to include and xsl:import to import stylesheet modules.
See http://www.w3.org/TR/xslt#include and http://www.w3.org/TR/xslt#import
As for using templates defined in an included or imported module, there is no difference doing that, use xsl:apply-templates or xsl:call-template the same as you do with other templates.
Additionally there is xsl:apply-imports (http://www.w3.org/TR/xslt#apply-imports) and in XSLT 2.0 there is xsl:next-match (http://www.w3.org/TR/xslt20/#apply-imports)

--
  Martin Honnen
  Microsoft MVP - XML





Similar Threads
Thread Thread Starter Forum Replies Last Post
xsl:param and xsl:apply-templates' "select" newbieboobers XSLT 1 March 25th, 2008 07:23 PM
Pass link values as xsl:parameter to php5 then xsl pauljr8 XSLT 1 July 2nd, 2007 10:32 PM
differnce between xsl:apply-templates and xsl:call chandu.mca007 XSLT 2 June 12th, 2007 04:12 AM
Including XSL in an <a href> graywoodhouse XSLT 2 November 12th, 2004 06:08 AM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.