This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Updating 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. 

<xsl:template match="item" mode="test">
<item>
<firstname>
<xsl:choose>
	<xsl:when test="$firstname"><xsl:value-of select="$firstname"/></xsl:when>
	<xsl:otherwise><xsl:value-of select="firstname"/></xsl:otherwise>
</xsl:choose>
</firstname>
<lastname>
<xsl:choose>
	<xsl:when test="$lastname"><xsl:value-of select="$lastname"/></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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]