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

RE: Transform param name to tagname in uppercase

Subject: RE: Transform param name to tagname in uppercase
From: "Philipp Kursawe" <phil.kursawe@xxxxxxxxx>
Date: Tue, 4 Mar 2008 19:31:33 +0100
RE:  Transform param name to tagname in uppercase
Thanks guys!

I am stuck with 1.0 and used the transform function. Works great!
Thanks again!

Phil 

> -----Original Message-----
> From: G. Ken Holman [mailto:gkholman@xxxxxxxxxxxxxxxxxxxx] 
> Sent: Saturday, March 01, 2008 23:58 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Transform param name to tagname in uppercase
> 
> At 2008-03-01 23:24 +0100, phil.kursawe@xxxxxxxxx wrote:
> >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
> >
> >So basically the parameter "name" should be transformed to a 
> tag in the 
> >final XML.
> >
> >Can anyone give me a starting point how to do that?
> 
> You don't say if you are using XSLT 1.0 or 2.0 ... to use 1.0 use the
> transform() function and values for upper-case and lower-case letters.
> 
> I hope this helps.
> 
> . . . . . . . . Ken
> 
> t:\ftemp>type phil.xml
> <params>
>    <param name="somename">value</param>
> </params>
> 
> t:\ftemp>type phil.xsl
> <?xml version="1.0" encoding="US-ASCII"?> <xsl:stylesheet 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                  version="2.0">
> 
> <xsl:output indent="yes"/>
> 
> <xsl:template match="params">
>    <INPUT>
>      <xsl:apply-templates/>
>    </INPUT>
> </xsl:template>
> 
> <xsl:template match="param">
>    <xsl:element name="{upper-case(@name)}">
>      <xsl:apply-templates/>
>    </xsl:element>
> </xsl:template>
> 
> </xsl:stylesheet>
> t:\ftemp>xslt2 phil.xml phil.xsl con
> <?xml version="1.0" encoding="UTF-8"?>
> <INPUT>
>    <SOMENAME>value</SOMENAME>
> </INPUT>
> t:\ftemp>
> 
> 
> --
> World-wide corporate, govt. & user group XML, XSL and UBL training
> RSS feeds:     publicly-available developer resources and training
> G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
> Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
> Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
> Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
> Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.