Closed
Bug 190631
Opened 22 years ago
Closed 22 years ago
value-of creates a textnode even if stringvalue is an empty string
Categories
(Core :: XSLT, defect)
Core
XSLT
Tracking
()
VERIFIED
FIXED
People
(Reporter: sicking, Assigned: sicking)
Details
Attachments
(1 file)
1.48 KB,
patch
|
axel
:
review+
peterv
:
superreview+
asa
:
approval1.3b+
|
Details | Diff | Splinter Review |
We call resulthandler->characters in the code for xsl:value-of even if the
calculated stringvalue is an empty string. This has two effects:
1. In the standalone-outputhandlers the following stylesheet
<out><xsl:value-of select="''"/></out>
gives the output "<out></out>" rather then "<out/>". This makes us fail a lot
of the string tests in xalan.
2. The following stylesheet
<out><xsl:value-of select="''"/><xsl:attribute name="foo"/></out>
will not create the attribute since we "close" the element when executing the
xsl:value-of.
The spec says on xsl:attribute: "The following are all errors: Adding an
attribute to an element after children have been added to it..."
And on xsl:value-of: "The string specifies the string-value of the created
text node. If the string is empty, no text node will be created."
So it's clear that we are doing the wrong thing.
There are two ways to solve this. Either we teach all the output-handlers to
ignore ::characters/::charactersNoOutputEscaping being called with an empty
string, or we make xsl:value-of not call the resulthandler if the string is empty.
I've done the latter since that's what the spec says.
Assignee | ||
Comment 1•22 years ago
|
||
i also included a small fix to get rid of a warning in the HTML-output-handler
where we were peek()-ing an empty stack
Assignee | ||
Updated•22 years ago
|
Attachment #112646 -
Flags: superreview?(peterv)
Attachment #112646 -
Flags: review?(axel)
Comment 2•22 years ago
|
||
Comment on attachment 112646 [details] [diff] [review]
patch to fix
if you believe it or not, r=axel@pike.org ;-)
Attachment #112646 -
Flags: review?(axel) → review+
Updated•22 years ago
|
Attachment #112646 -
Flags: superreview?(peterv) → superreview+
Assignee | ||
Comment 3•22 years ago
|
||
Comment on attachment 112646 [details] [diff] [review]
patch to fix
this is a very lowrisk patch since it hardly changes any logic. It's fully
contained to XSLT, no other pages will be affected.
Attachment #112646 -
Flags: approval1.3b?
Comment 4•22 years ago
|
||
Comment on attachment 112646 [details] [diff] [review]
patch to fix
a=asa (on behalf of drivers) for checkin to 1.3beta.
Attachment #112646 -
Flags: approval1.3b? → approval1.3b+
Assignee | ||
Comment 5•22 years ago
|
||
checked in. thanks for reviews
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•