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

Updating Childelements

Subject: Updating Childelements
From: "bernward hanssen" <bernwardhanssen@xxxxxx>
Date: Wed, 28 Nov 2001 14:05:52 +0100
childelements
Hi 


I want to update childelements when the are passed as parameters with the same name as the childelement. 
The following works, but I think it is not the way to do it in xsl. 

&lt;xsl:template match="item" mode="test">
&lt;item>
&lt;firstname>
&lt;xsl:choose>
	&lt;xsl:when test="$firstname">&lt;xsl:value-of select="$firstname"/>&lt;/xsl:when>
	&lt;xsl:otherwise>&lt;xsl:value-of select="firstname"/>&lt;/xsl:otherwise>
&lt;/xsl:choose>
&lt;/firstname>
&lt;lastname>
&lt;xsl:choose>
	&lt;xsl:when test="$lastname">&lt;xsl:value-of select="$lastname"/>&lt;/xsl:when>
	<xsl:otherwise>&lt;xsl:value-of select="lastname"/>&lt;/xsl:otherwise>
&lt;/xsl:choose>
</lastname>
&lt;!--  -->
&lt;!-- and that for each element -->
&lt;!--  -->
&lt;/item>
&lt;/xsl:template>

Knows anybody a better solution? 
I try the following, but it doesn't work.

&lt;xsl:template match="*" mode="update">
	&lt;xsl:variable name="el">
		&lt;xsl:value-of select="name()"/>
	&lt;/xsl:variable>
	&lt;xsl:element name="{$el}">

	&lt;xsl:variable name="el">
		&lt;xsl:value-of select="concat('$',name())"/>
&lt;!-- this is only the name of the Parameter, I need the content of the Parameter -->
	&lt;/xsl:variable>
&lt;/xsl:template>
________________________________________________________________
Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr! 
Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13



 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.