Closed
Bug 264369
Opened 20 years ago
Closed 18 years ago
Escaping of '>' not compliant with 10.2.1.1 of ECMA 357
Categories
(Rhino Graveyard :: E4X, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.6R6
People
(Reporter: kthomas, Unassigned)
References
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7a) Gecko/20040219 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7a) Gecko/20040219 Spec says a. If (c == "<"), let r be the result of concatenating r and the string"<" b. Else if (c == ">"), let r be the result of concatenating r and the string ">" c. Else if (c == "&"), let r be the result of concatenating r and the string "&" Rhino is not obeying b. Reproducible: Always Steps to Reproduce: 1. Execute this code: x = <a/>; chars = "<>&"; x.b = chars; 2. Inspect x.toXMLString() Actual Results: <a> <b><>&</b> </a> Expected Results: <a> <b><>&</b> </a> I believe that if < is autoescaped, > should be also. Otherwise we're breaking people's XML (and not complying with ECMA 357 10.2.1.1, I think). As a side issue, I think ECMA 357 10.2.1.1 should have gone all the way and specified escaping all of the XML illegals, including ' and ". Otherwise a lot of illegal XML gets created. As it now stands, ECMA 357 and XInclude (text-mode) are out of agreement. I think it would be good if they agreed on how to handle all 5 XML illegals.
Comment 1•20 years ago
|
||
Please file Rhino bugs against the Rhino bugzilla.mozilla.org product. /be
Assignee: general → nobody
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → E4X
Ever confirmed: true
Product: Browser → Rhino
Version: Trunk → 1.5R1
Updated•20 years ago
|
Assignee: nobody → igor
Comment 2•20 years ago
|
||
(In reply to comment #0) > As a side issue, I think ECMA 357 10.2.1.1 should have gone all the way and > specified escaping all of the XML illegals, including ' and ". Otherwise a lot > of illegal XML gets created. As it now stands, ECMA 357 and XInclude > (text-mode) are out of agreement. I think it would be good if they agreed on how > to handle all 5 XML illegals. Why do you think that ', ", and > are illegal? Here is a mail from Eric Vasilik that I got when investigating the issue (Rhino uses http://xmlbeans.apache.org/ to implement E4X and directly call xmlText method there): -------- Original Message -------- Subject: RE: No escape for '>' ? Date: Fri, 15 Oct 2004 11:31:46 -0700 From: Eric Vasilik Reply-To: user@xmlbeans.apache.org To: <user@xmlbeans.apache.org> I do not believe that "<a><>&</a>" is invalid. The '>' character does not need to be escaped. Here is the BNF for char data from the XML spec. [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*) It requires that there are no un-escaped '&' or '<' characters, as well as the CDATA terminating character sequence. - Eric > -----Original Message----- > From: Igor Bukanov [mailto:igor@fastmail.fm] > Sent: Friday, October 15, 2004 6:10 AM > To: user@xmlbeans.apache.org > Subject: No escape for '>' ? > > Hi! > > It seems that xmlText() does not escape '>'. For example, > xmlCursor.xmlText() when xmlCursor points to a XML fragement <a>TEXT</a> > where TEXT is "<>&" produces instead of the expected > <a><>&</a> > the following invalid XML: > <a><>&</a> > > Regards, Igor
Comment 3•19 years ago
|
||
Reassigning to please_see_bug_288433@eml.cc pending resolution of bug 288433
Assignee: igor.bukanov → please_see_bug_288433
Updated•19 years ago
|
Assignee: please_see_bug_288433 → nobody
Comment 4•18 years ago
|
||
This bug is fixed in the upcoming DOM-only (non-XMLBeans) version of E4X support. See bug 355677.
Status: NEW → ASSIGNED
Depends on: 355677
Comment 5•18 years ago
|
||
Rhino now passes this test if XMLBeans is not present (see bug 355677).
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 6•18 years ago
|
||
Adding target milestone of 1.6R6 based on the date this bug was resolved FIXED.
Target Milestone: --- → 1.6R6
You need to log in
before you can comment on or make changes to this bug.
Description
•