  | |  | Character escaping issues in xalan-1 to xalan-2 migration | Character escaping issues in xalan-1 to xalan-2 migration 2003-04-29 - By kroberts@(protected)
I have observed an inconsistency in the escaping of characters while migrating from a xalan-1 to xalan-2, 2.5.0. Here is a snippet of the stylesheet:
<xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/> ... <xsl:attribute name="href"><![CDATA[?NewPatient=true&PatientName =]]><xsl:value-of disable-output-escaping="yes" select="$PatientName"/><![CDATA[&UnitNum=]]><xsl:value-of disable-output-escaping="yes" select="$UnitNum"/><![CDATA[&MRNumber=]]><xsl:value-of disable-output-escaping="yes" select="$MRNumber"/><![CDATA[&Sex=]]><xsl:value-of disable-output-escaping="yes" select="$Sex"/><![CDATA[&BirthDate=]]><xsl:value-of disable-output-escaping="yes" select="$BirthDate"/><![CDATA[&RawDate=]]><xsl:value-of disable-output-escaping="yes" select="$RawDate"/><![CDATA[&DeathDate=]]><xsl:value-of disable-output-escaping="yes" select="$DeathDate"/>
in xalan-1 it produced the following html:
href="?NewPatient=true&PatientName=DOE, JANE&UnitNum=10088&MRNumber=CC753422&Sex=F&BirthDate= &RawDate=&DeathDate=
in xalan 2.5.0 it produced:
?NewPatient=true&PatientName=DOE, JANE&UnitNum=10088&MRNumber=CC753422&Sex=F&BirthDate=&RawDate =%C2%A0&DeathDate=%C2%A0
If I understand the stylesheet correctly; escaping should not occur at all because of CDATA and disable-output-escaping. In xalan-1 escaping did occur; but in xalan-2; it appears that it does not occur. Was this something that was fixed or am I not understanding something? It looks like I'll have to change this stylesheet to allow escaping to occur.
The dates are being selected as follows in the stylesheet: <xsl:template name="DOB"> <xsl:param name="candidate"/> <xsl:param name="raw" select="'false'"/> <xsl:choose> <xsl:when test="$raw!='true'"> <xsl:call-template name="DATE"> <xsl:with-param name="RawDate" select ="$candidate/memberInfo/dateOfBirth/birthDate"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select ="$candidate/memberInfo/dateOfBirth/birthDate"/> </xsl:otherwise> </xsl:choose> </xsl:template
The strange characters %C2%A0 are coming back when datOfBirth/birthDate or dateOfDeath elements are not contained in the xml document being transformed. Is this a bug?
Appreciate any ideas that may solve this issue.
Keith...
|
|
 |