Re: [xsl] Insert new element depending on value of attribute

Subject: Re: [xsl] Insert new element depending on value of attribute
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Mon, 18 Feb 2008 19:26:59 +0100
Gerhard Glatz wrote:

Does anybody have a hint, where and how I should add something like
<xsl:if test="multipart/@attribute=desired_value"> ??

I think you want e.g.
<xsl:template match="disk/tracks[track[multipart[@attribute = 'value']]]">
<xsl:copy>
<xsl:apply-templates select="@* | node()">
<track>
<length>
<xsl:value-of select="select-what-you-need-here"/>
</length>
</track>
</xsl:copy>
</xsl:template>
plus the identity transformation template.





--


	Martin Honnen
	http://JavaScript.FAQTs.com/

Current Thread