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 2002/03/05 03:29:46 UTC
DO NOT REPLY [Bug 4546] -
normalize-space does not properly handle text data
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=4546>.
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=4546
normalize-space does not properly handle text data
------- Additional Comments From mrainey@probusiness.com 2002-03-05 02:29 -------
I have observed some strange behavior with normalize-space() in 2.3.1 that does
not occur with 2.2.0. It may or not be related to this bug. The problem is
that longer strings have extra spaces erroneously removed -- effectively
joining words.
Here is the sample XSLT fragment:
<xsl:text>statement = pConnection.prepareStatement("</xsl:text>
<xsl:value-of select="normalize-space($statement/text)"/>
<xsl:text>");</xsl:text>
Here is the sample input data fragment:
<text>select OrderID, CustomerID, EmployeeID, OrderDate,
RequiredDate, ShippedDate, Freight, ShipName, ShipAddress, ShipCity,
ShipRegion, ShipPostalCode, ShipCountry
from Orders where OrderID = ?</text>
Please note that the carriage returns and leading spaces are part of the test
data.
Here is the text output:
statement = pConnection.prepareStatement("select OrderID, CustomerID,
EmployeeID, OrderDate, RequiredDate, ShippedDate, Freight, ShipName,
ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry from Orders
whereOrderID = ?");
The extra white space removal causes the joining of the words "where"
and "OrderID" towards the end of the string -- strangely enough white space in
the remainder of the string is handled correctly. I have seen this behavior
with a number of strings that are approximately the same size.
Again, this behavior does not seem to occur with 2.2.0.