st***************@googlemail.com wrote:
how can i transform this source-xml in the target xml? is it possible
to get <a>Ax</aenclosed?
source-xml:
<z>
A1
<b>B1</b>
A2
</z>
desired target-xml:
<z>
<a>A1</a>
<b>B1</b>
<a>A2</a>
</z>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="z/text()[starts-with(normalize-space(.), 'A')]">
<a>
<xsl:value-of select="normalize-space(.)"/>
</a>
</xsl:template>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
--
Martin Honnen
http://JavaScript.FAQTs.com/