This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: variable match attribute
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] variable match attribute
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Fri, 13 Jul 2001 12:13:49 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> <xsl:template match="$pattern">
> <!-- do something -->
> </xsl:template>
>
> I know, the match attribute is a pattern, where I can't use variables
> but how can I solve the problem:
> 'read element names from a document B and use them as template pattern
> in document a'
If the pattern is always a simple element name you can do
<xsl:template match="*">
<xsl:choose>
<xsl:when test="name()=$pattern">
etc.
Otherwise, it might be best to think in terms of generating the stylesheet
dynamically.
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list