[Home] [By Thread] [By Date] [Recent Entries]
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/
|

Cart



