Hi Folks,
The value of $legacy-elmt is this element:
<test>Hello, world</test>
Create a variable which holds between single quotes the value of the element
that $legacy-elmt holds. Do this using a two-step process:
<xsl:variable name="tmp-legacy-elmt-value" as="xs:string+">
<xsl:text>'</xsl:text>
<xsl:value-of select="string($legacy-elmt)"/>
<xsl:text>'</xsl:text>
</xsl:variable>
<xsl:variable name="legacy-elmt-name" as="xs:string">
<xsl:value-of select="$tmp-legacy-elmt-value" separator=""/>
</xsl:variable>
$legacy-elmt-value = 'Hello, world'
That appears to work flawlessly, right?
Not so fast.
Suppose the value of $legacy-elmt is this element:
<test>O'Neil</test>
$legacy-elmt-value = 'O'Neil'
That is an error (unmatched single quote).
What is the best way to fix this error?
/Roger
|