WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
25185
XSLT Text Transform: contains(TAB) matches SPACE
https://bugs.webkit.org/show_bug.cgi?id=25185
Summary
XSLT Text Transform: contains(TAB) matches SPACE
Doeke Zanstra
Reported
2009-04-14 10:49:03 PDT
I'm transforming an XML document with an XSLT document to a text string (output method=text) with the XSLTProcessor. It seems the selector text()[contains(.,'	')] matches a space ( ) and instead of the specified tab (	). I'm not to sure if the conclusion is correct, but Gecko (Firefox, Camino) is matching correctly. The bug appears on the nightly build, but also on Safari 4 latest beta windows and Google Chrome 2 latest beta.
Attachments
Add attachment
proposed patch, testcase, etc.
Doeke Zanstra
Comment 1
2009-04-14 11:01:36 PDT
Testcase in the URL. When transforming the XML without script, it's working as expected (no bug is showing). Case:
http://mcbak.local/~doekman/bugs/xslt-tab.xml
Alexey Proskuryakov
Comment 2
2009-04-15 01:22:15 PDT
This is a difference in what steps are taken for XSLT processing. When the HTML code is parsed, 	 is replaced with 	. DOMParser replaces that with a tab character. These steps work identically in WebKit and in Gecko. However, WebKit's XSLTProcessor serializes both documents to strings to pass them to libxslt. When libxml2/lixslt parse the string containing a tab character, they correctly convert it to a space (see section 3.3.3 "Attribute-Value Normalization" of XML 1.0). On the other hand, Gecko operates on the existing DOM tree. In contrast with
bug 14530 comment 3
, I think that Gecko is correct here. See also:
bug 14101
.
Alex Milowski
Comment 3
2010-01-22 16:06:45 PST
This seems like one of those "under specified" edge cases. There is nothing wrong with serialization and, as such, you should expect to be able to match tab characters. You cannot parse an XSLT stylesheet document with an XML parser and expect a tab character in your match pattern. Via Javascript, you can create a XML DOM with a tab character in the match attribute. As such, you can give the XSLT compiler an instance that you cannot receive from the XML parser. I'm not sure I would classify this as a bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug