Closed Bug 347794 Opened 20 years ago Closed 19 years ago

Rhino started with xmlbeans, but I'm not able to access E4X.

Categories

(Rhino Graveyard :: E4X, defect)

x86
Windows XP
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: schmitt-js, Unassigned)

References

()

Details

User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon; .NET CLR 1.1.4322; .NET CLR 2.0.50727) Build Identifier: E4X not available Calling Rhino with xmlbeans in the classpath doesn't allow to use E4X. No error is reported from java neither rhino. Reproducible: Always Steps to Reproduce: 1.I createded a batch file with (Idea from "Scripting XML processing using E4X"): java -cp "D:/xmlbeans-2.2.0/lib/xbean.jar";"D:/xmlbeans-2.2.0/lib/jsr173_api.jar";js.jar org.mozilla.javascript.tools.shell.Main XMLBeans are installed in D:\xmlbeans-2.2.0\lib. Changing form / to \ in the batch above makes no difference. 2.I get the prompt js> all seems fine but no E4X features Actual Results: D:\rhino1_6R3>java -cp "D:/xmlbeans-2.2.0/lib/xbean.jar";"D:/xmlbeans-2.2.0/lib/jsr173_api.jar";js.j ar org.mozilla.javascript.tools.shell.Main Rhino 1.6 release 3 2006 07 24 js> var a = <name id="23"> <firstname type="standard">ToBeSet</firstname> <firstname type="common"> Java</firstname> <lastname>Script</lastname> </name> js: "<stdin>", line 2: uncaught JavaScript runtime exception: ReferenceError: "XML" is not defined. js> Expected Results: js> a <name id="23"> <firstname type="standard">ToBeSet</firstname> <firstname type="common">Java</firstname> <lastname>Script</lastname> </name> js> typeof(a) xml My java installation is in C:\Programme\Java\jre1.5.0_07
The problem is that rhino works only with the xml-beans-1.0.3 version and not the newer releases of xmlbeans. The release 1.0.3 is relative old and not longer available so please bind rhino with a newer release of xmlbeans. Thanks.
I am not entirely sure but there are a couple of possibilities. First, in my copy of XMLBeans the jsr173 JAR file has a name other than that indicated in your sample above, so it could be that simple. Or, the js.jar file could have been built without E4X support. Can you take a look at those things and we'll go from there?
P.S. I am running with XMLBeans 2.2.0, so that's not the problem. Also, there is a coming non-XMLBeans implementation of E4X that will work without any configuration (on JDK 1.5+). See bug 355677.
Running exact test case given: $ $jdk/bin/java -classpath `cygpath -wp /opt/java/apache/xmlbeans/2.2.0/lib/xbean.jar:/opt/java/apache/xmlbeans/2.2.0/lib/jsr173_1.0_api.jar:/home/inonit/dev/contrib/rhino/build/remote/dist/js.jar` org.mozilla.javascript.tools.shell.Main Rhino 1.6 release 6 Pre 2007 02 06 js> var a = <name id="23"> <firstname type="standard">ToBeSet</firstname> <firstname type="common"> Java</firstname> <lastname>Script</lastname> </name> js> print(a.toXMLString()) <name id="23"> <firstname type="standard">ToBeSet</firstname> <firstname type="common">Java</firstname> <lastname>Script</lastname> </name> Closing as WORKSFORME.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.