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

Re: question on calling templates

Subject: Re: question on calling templates
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 29 Aug 2002 23:27:18 +0100
Re:  question on calling templates
Noel Golding wrote:
> try
>
> <xsl:call-template name="{$currentTemplate}"/>

I guess he could try, but it won't work. Attribute value templates
(setting attribute values by putting an expressing within {}s) only
works with literal attributes on literal result elements, e.g.:

  <foo bar="{$baz}" />

and on certain attributes within XSLT, namely those attributes on
instructions (XSLT elements used within templates) that expect literal
values. It doesn't work on any select/test/match attribute (which hold
XPaths) or on attributes that hold a (qualified) name that needs to be
understood by the processor at compile time (e.g. the 'name' attribute
on xsl:call-template or xsl:variable or the 'mode' attribute on
xsl:apply-templates).

The best place to check whether an attribute on an XSLT instruction is
interpreted as an attribute value template is the XSLT Rec. In the
syntax specifications in the Rec, all the attributes that can hold
attribute value templates are indicated by {}s around the
specification of the attribute value. For example, xsl:sort is defined
as:

<xsl:sort
  select = string-expression 
  lang = { nmtoken }
  data-type = { "text" | "number" | qname-but-not-ncname }
  order = { "ascending" | "descending" }
  case-order = { "upper-first" | "lower-first" } /> 

showing that all the attributes except for the select attribute can
hold attribute value templates.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.