ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
Re: [xsl] applying templates to an attribute
by Joerg Heinicke other posts by this author
Dec 18 2001 11:57PM messages near this date
Re: [xsl] applying templates to an attribute - and adding markup | Re: [xsl] applying templates to an attribute - and adding markup
>  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
Thread:
Eric Smith
Joerg Heinicke
Joerg Heinicke
Eric Smith
David Carlisle
Michael Kay
Wendell Piez

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved