[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Applying a template on values in attributes ?

Subject: RE: Applying a template on values in attributes ?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 3 Aug 2005 22:06:34 +0100
RE:  Applying a template on values in attributes ?
> I have an html element as follows:
> 
> <input type="hidden" value="{TotalAdultFare}" />
> 
> I want to apply a template to TotalAdultFare.
> 
> If I do this by <xsl:attribute
> name="value"><xsl:call-template></xsl:call-template</xsl:attribute>
> then the problem is that the output is as follows:
> 
> <input type="hidden" value="1000"></input>
> 
> I want to avoid this somehow.. any ideas ?

Firstly "applying templates" usually means xsl:apply-templates, not
xsl:call-template, and you apply templates to a node, not to a value.

Secondly, xsl:call-template always has a name="xxx" attribute.

Thirdly, the value you get in your attribute is set by the template that you
call (or apply). If you don't want the value 1000 in there and want
something different, then change your template so it sets a different value.

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.