XSLT Variable output
I'm using XSLT 2.0 and Oxygen editor with Saxon 9B.
When I use the below template to the input <syntax> element, I get the output <AID>. Why don't I get the <test> element in the output? Any element given inside a variable cannot be printed. Is there any way to do it?
My XML snippet is shown below:
<Syntax>SET‑ATTR‑EQPT:[<TID>]:<AID>:<CTAG>::[<NTFCNCDE>],<CONDTYPE>,[<LOCN>],[<DIRN>],,[<SRVEFF>];</Syntax>
My template is :
<xsl:template match="Syntax">
<xsl:variable name="cmdSyntax">
<xsl:analyze-string select="." regex="^.*?:.*?:(.*?):.*$">
<xsl:matching-substring>
<test>
<xsl:value-of select="regex-group(1)"/>
</test>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:variable>
<xsl:value-of select="$cmdSyntax"></xsl:value-of>
</xsl:template>
My output is :
<AID>
Required output is :
<test><AID></test>
thanks in advance,
__________________
Rummy
|