You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/08/07 17:01:41 UTC
DO NOT REPLY [Bug 22218] New: -
Passing normalize-space on node value into the apply-templates
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22218>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22218
Passing normalize-space on node value into the apply-templates
Summary: Passing normalize-space on node value into the apply-
templates
Product: XalanC
Version: 1.3.x
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: XalanC
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: ddgelfand@cifnet.com
CC: ddgelfand@cifnet.com
Hello,
I have an issue with Xalan 1.3, running on AIX system when I pass xml node with
normalize-space call into apply-templates function.
(I fork the process from my "C" application and executes testXSLT driver.
>>testXSLT -in input.xml -xsl input.xsl
)
The issue appears ONLY if my xml value has double (or more) space following
each other. For example, "My Value" (with 2 spaces) will return the below
error, but "My Value" (single space) will executes correctly.
Error:
XSLException Type is: XObjectInvalidConversionException
Message is: Cannot convert a #STRING to a node set. (Unknown URI, line -1,
column -1)
XML example:
....
<customer>
<subscriber>
<subcode>My Value</subcode>
</subscriber>
</customer>
++++++++++++++++++++++++++++++++++++++++++
XSL Example:
<xsl:template match="subscriber">
SUBCODE=<xsl:apply-templates select="normalize-space(subcode)"/>
</xsl:template>
<xsl:template match="subcode">
<xsl:value-of select="translate(.,
'abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
</xsl:template>
In order to fix this issue,
I called normalize-space inside my apply-templates and it seems fixed my
problem.
thank you,
-dg
ps: IMHO, when xslt parser calls normalize-space function, it stores result in
the _local_ temp. variable which is passing into the second template.