xsl-list
[Top] [All Lists]

RE: [xsl] Transform param name to tagname in uppercase

2008-03-01 16:18:28
I have not been in touch with XSLT for a couple of years now 
and this simple transformation I can not describe in XSLT:
<params>
  <param name="somename">value</param>
</params>

should be transformed to:

<INPUT>
  <SOMENAME>value</SOMENAME>
</INPUT


<xsl:template match="params">
<INPUT>
  <xsl:element name="{upper-case(param/@name)}">
   <xsl:value-of select="param"/>
  </xsl:element>
</INPUT>
</xsl:template>

The upper-case() function is 2.0. If for some reason you're stuck with 1.0,
use translate(xxx, 'abc...', 'ABC...')

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>