This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: difference between xsl:include and xsl:import
- From: "Bryan Rasmussen" <bry at itnisk dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 20 Feb 2002 14:50:45 +0100
- Subject: RE: [xsl] difference between xsl:include and xsl:import
- Keywords: xsltDEV
- Reply-to: xsl-list at lists dot mulberrytech dot com
>Hi, can someone tell me how (or is it possible) to separate the xpath
>expression, and whether it is possible to create such so that the end user
>can customerise their own xpath.
>from the xsl stylesheet? also, can somebody tell me what's the difference
>between xsl:import and xsl:include
without use of extension functions you can't really seperate the xpath, if
what you mean by that is to write something like
<ref xpath="/books/book[name='mybook']"/>
however one could have something like <ref element="book"/>
and have something like
<xsl:template match="ref">
<xsl:variable name="elementName" select="@element"/>
<xsl:for-each select="//*[name()=$elementName]">
do something here
</xsl:for-each>
</xsl:template>
this method can be used, with a bit of string processing to build up complex
xpaths of a particular structure.
the short explanation for the second is that xsl:import one can override the
imported stylesheets templates, and in xsl:include one cannot
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list