I'm new to XSLT and need to solve a nasty problem and I've no change to solve it. The following example describes my problem:
<a>
<b1><![CDATA[<CdtrRefInf><Issr>XXX</Issr></Tp><Ref>123456123]]></b1>
<b2><![CDATA[193</Ref></CdtrRefInf>]]></b2>
</a>
The expected oucome should be:
<a>
<b1>123456123193<b1>
</a>
I need to iterate over the elements b1 and b2 and concatenate the content into a variable. Then I need to take the content of the Ref element and put this in the b1 element. The following code concatenate the content of the fields b1 and b2 together. But how to put it in the above format?????
<xsl:template match="/*">
<xsl:variable name="vMyVars">
<xsl:apply-templates select="b1 | b2 " mode="vMyVars"/>
</xsl:variable>
<xsl:value-of select="substring($vMyVars, -1, string-length($vMyVars))"/>
</xsl:template>
<xsl:template match="*" mode="vMyVars"/>
<xsl:template match="*[normalize-space()]" mode="vMyVars">
<xsl:value-of select="."/>
<!--<xsl:text>, </xsl:text>-->
</xsl:template>
Any advise is welcome. Regards Dirk