Closed Bug 320812 Opened 19 years ago Closed 17 years ago

Cannot create XML object from Java

Categories

(Rhino Graveyard :: E4X, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lipp, Unassigned)

References

Details

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
It is Context.topCallScope which is null, of course.
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
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?
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
This code now works if XMLBeans is not present.  See bug 355677.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
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.