Closed
Bug 292863
Opened 20 years ago
Closed 12 years ago
E4X: undeclaring namespace prefixes is not allowed in XML 1.0 with namespace (e4x/Namespace/regress-292863.js)
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: martin.honnen, Unassigned)
References
Details
(Whiteboard: INVALID?)
With namespaces in XML 1.0 once you bind a prefix to a namespace using a special
xmlns:prefix="namespaceURI"
attribute you cannot undeclare the prefix e.g.
xmlns:prefix=""
is not allowed so a parser should yield a parser error if such a construct occurs.
Spidermonkey however does not give a parse error while Rhino does.
Test case:
var godList = <gods:gods xmlns:gods="http://example.com/2005/05/04/gods">
<god xmlns:god="">Kibo</god>
</gods:gods>;
print(godList);
Spidermonkey's behaviour: loads the file without problems, parses the XML
without giving a parse error:
js> load('test2005050401.js')
<gods:gods xmlns:gods="http://example.com/2005/05/04/gods">
<god xmlns:god="">Kibo</god>
</gods:gods>
Expected behaviour would be like Rhino's behaviour:
js> load('test2005050401.js')
js: "C:\SomePath\javascript\test2005050401.js", line 1: uncaught JavaScript
runtime exception: TypeError: error: The value of the attribute
"prefix="xmlns",localpart="god",rawname="xmlns:god"" is invalid. Prefixed
namespace bindings may not be empty.
Updated•20 years ago
|
Flags: testcase?
Comment 1•20 years ago
|
||
/cvsroot/mozilla/js/tests/e4x/Namespace/regress-292863.js,v <-- regress-292863.js
initial revision: 1.1
Status: NEW → ASSIGNED
Flags: testcase? → testcase+
Comment 2•20 years ago
|
||
Not sure what I (or today's build) is doing wrong, but I don't think I marked
the bug assigned.
Status: ASSIGNED → NEW
Comment 3•20 years ago
|
||
I believe this bug report is invalid.
http://www.w3.org/TR/xml-names11/ does not say that xmlns:...="" is invalid,
indeed it seems to allow it.
Whiteboard: INVALID?
Reporter | ||
Comment 4•20 years ago
|
||
(In reply to comment #3)
> I believe this bug report is invalid.
>
> http://www.w3.org/TR/xml-names11/ does not say that xmlns:...="" is invalid,
> indeed it seems to allow it.
But E4X implements XML 1.0 with namespaces and there it is not allowed to
"undeclare" a prefix i.e. to use xmlns:prefix="". See
<http://www.w3.org/TR/REC-xml-names/#ns-decl>
where it says
"If the attribute name matches PrefixedAttName, then the NCName gives the
namespace prefix, used to associate element and attribute names with the
namespace name in the attribute value in the scope of the element to which the
declaration is attached. In such declarations, the namespace name may not be empty."
Comment 5•19 years ago
|
||
The current test in the test suite actually assumes the correct behavior is no error which is inconsistent with this report. Should I fix the testcase or mark this bug as works for me?
Reporter | ||
Comment 6•19 years ago
|
||
(In reply to comment #5)
> The current test in the test suite actually assumes the correct behavior is no
> error which is inconsistent with this report. Should I fix the testcase or mark
> this bug as works for me?
I think that parsing xmlns:pf="" without throwing a parse error is a bug as E4X follows the XML 1.0 and XML 1.0 with namespaces specification and there xmlns:pf="" is not allowed.
In my view the test case needs to be fixed if it does not require the parse error to be thrown as the proper outcome of the test.
Comment 7•18 years ago
|
||
(In reply to comment #6)
> In my view the test case needs to be fixed if it does not require the parse
> error to be thrown as the proper outcome of the test.
Sorry it took so long.
Checking in regress-292863.js;
/cvsroot/mozilla/js/tests/e4x/Namespace/regress-292863.js,v <-- regress-292863.js
new revision: 1.2; previous revision: 1.1
done
Comment 8•18 years ago
|
||
Igor, can you chime in on if this is a real failure or not?
Comment 9•17 years ago
|
||
was:E4X; undeclaring namespace prefixes is not allowed in XML 1.0 with namespace but Spidermonkey does not give a parse error
adding test to summary for search goodness.
Summary: E4X; undeclaring namespace prefixes is not allowed in XML 1.0 with namespace but Spidermonkey does not give a parse error → E4X: undeclaring namespace prefixes is not allowed in XML 1.0 with namespace (e4x/Namespace/regress-292863.js)
Comment 10•17 years ago
|
||
is this related to bug 410740
Comment 11•12 years ago
|
||
E4X will be removed again from Spidermonkey (bug 788293)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•