Cannot create XML object from Java

RESOLVED FIXED in 1.6R6

Status

Rhino
E4X
RESOLVED FIXED
13 years ago
11 years ago

People

(Reporter: Michael Lipp, Unassigned)

Tracking

other
1.6R6
x86
Windows 2000

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

The code

Scriptable xo = cx.newObject (scope, "XML");

(with scope = cx.initStandardObjects(null)) fails because Context.topLevelScope is null. According to the doc, this call should work, however.

Reproducible: Always
(Reporter)

Comment 1

13 years ago
It is Context.topCallScope which is null, of course.

Comment 2

12 years ago
Reassigning to please_see_bug_288433@eml.cc pending resolution of bug 288433
Assignee: igor.bukanov → please_see_bug_288433
Assignee: please_see_bug_288433 → nobody

Comment 3

12 years ago
When I do this:

Context cx = Context.enter();
Scriptable scope = cx.initStandardObjects(null);
cx.newObject(scope, "XML");

I get:

Exception in thread "main" org.mozilla.javascript.EcmaError: TypeError: Not Parsable as XML
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3226)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3216)
	at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3232)
	at org.mozilla.javascript.xmlimpl.XML.createFromJS(XML.java:384)
	at org.mozilla.javascript.xmlimpl.XML.jsConstructor(XML.java:3043)
	at org.mozilla.javascript.xmlimpl.XMLObjectImpl.execIdCall(XMLObjectImpl.java:546)
	at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:124)
	at org.mozilla.javascript.BaseFunction.construct(BaseFunction.java:310)
	at org.mozilla.javascript.Context.newObject(Context.java:1462)
	at org.mozilla.javascript.Context.newObject(Context.java:1433)
	at Test.main(Test.java:10)

So, it looks like it fails differently than you said. Can you provide a stack trace that you got? And provide the Rhino version? Also, what docs say that this should work?

Comment 4

12 years ago
This code executes correctly in the coming DOM (non-XMLBeans) E4X implementation (see Bug 355677).  Hope my attempt to link the two above works.
Status: NEW → ASSIGNED
Depends on: 355677

Comment 5

12 years ago
This code now works if XMLBeans is not present.  See bug 355677.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED

Comment 6

11 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.