This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: difference between xsl:include and xsl:import





>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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]