xsl-list
[Top] [All Lists]

Combining translate() and apply-templates

2005-01-26 11:04:55
Hello, all... :)

I have been searching for a solution to this for weeks, to no avail...

I have the following xml:

<new_rel>
  <title>New Title Here</title>
  <rating>PG</rating>
</new_rel>

In certain instances in my xsl, the title needs to be translated to all upper 
case:

<xsl:value-of select="translate(./title,$lower,$upper)" />

where $lower and $upper are defined at the top of the document.

The problem is that sometimes the title node includes templates for special 
characters (i.e. spanish language characters, tildas, etc). So sometimes the 
xml looks like this:

<new_rel>
  <title>L<eacute /> Divorce</title>
  <rating>PG</rating>
</new_rel>

where <eacute /> has a template that puts in an &eacute; character.

How can I apply the templates in the node and still have the value translate() 
to upper case? Something like this (although I am aware that this code is 
improper):

<xsl:apply-templates select="translate(./title,$lower,$upper)" />

Thanks!

Cynthia

--~------------------------------------------------------------------
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>