xsl-list
[Top] [All Lists]

RE: Applying a template on values in attributes ?

2005-08-03 14:06:34

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/




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>