|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Can i use apply-templates to match a xsl:template
Chris,
Going by the subjectline, if you want a template in an xstl stylesheet to find other elements in the same stylesheet, do something like the following: <xsl:template match="/">
<xsl:for-each select="document('')/*/xsl:template">
<xsl:value-of select="@match"/>
</xsl:for-each>
</xsl:template>Here the document() function, with an empty-string, returns the containing xslt document...which is an xml document, and which we navigate as usual. Needing to seach for an xsl:template within the same stylesheet can be useful if one od the "templates" actually holds some soft of mapping or lookup information which is best kept in-situ in the xslt document rather than in a separate file. FYI, document('/') returns the main input xml document in similar fashion (at least under xalan). Regards, --A From: Chris <phatfish@xxxxxxxxx> _________________________________________________________________ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








