This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: applying templates to an attribute
- From: "Joerg Heinicke" <joerg dot heinicke at gmx dot de>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 19 Dec 2001 00:57:23 +0100
- Subject: Re: [xsl] applying templates to an attribute
- References: <20011218234013.N4316@apple.fruitcom.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> I find the following very useful and simple.
> ( BTW $output is a parameter)
>
> xml:
>
> John <alt executive="is creating" other="has created" another="will
create"/>
> a new product.
>
> xsl:
>
> <xsl:template match="alt">
> <xsl:value-of select="@*[name()=$output]"/>
> </xsl:template>
>
> But I cannot put any markup in the content, like if I want
> John <i>will</i> create a new product.
>
> Any suggestions?
What do you mean? What's the problem with
<xsl:template match="alt">
<i><xsl:value-of select="@*[name()=$output]"/></i>
</xsl:template> ??
On the other hand you can apply templates like elements:
<xsl:template match="alt">
<xsl:apply-templates select="@*[name()=$output]"/>
</xsl:template>
<xsl:template match="@*">
<i><xsl:value-of select="."/></i>
</xsl:template>
Or did I understand something completely wrong?
Regards,
Joerg
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list