Details
-
Bug
-
Status: Resolved
-
Resolution: Incomplete
-
1.5
-
None
-
None
-
Operating System: other
Platform: Other
Description
The JavaScript line:
parseXML(result.content, document);
does not work if the content include a XML header like:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
You can simple reproduce it if you add this header to the SVG file:
samples\solitaire\cards\default.svg
Then solitare does not work. It produce the follow stacktrace:
org.mozilla.javascript.EcmaError: TypeError: Cannot convert null to an object.
(Inline <script> file:/c:/output/1/SvgViewer.svg:7#20)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3240)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3230)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3246)
at org.mozilla.javascript.ScriptRuntime.typeError0(ScriptRuntime.java:3252)
at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:869)
at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:827)
at org.mozilla.javascript.Context.toObject(Context.java:1673)
at org.apache.batik.script.rhino.WindowWrapper.parseXML(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:174)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:393)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:94)
at org.mozilla.javascript.gen.c3._c3(Inline <script>
file:/c:/output/1/SvgViewer.svg:7:20)
at org.mozilla.javascript.gen.c3.call(Inline <script>
file:/c:/output/1/SvgViewer.svg:7)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769)
at org.mozilla.javascript.gen.c3.call(Inline <script>
file:/c:/output/1/SvgViewer.svg:7)
at org.apache.batik.script.rhino.RhinoInterpreter.callHandler(Unknown Source)
at
org.apache.batik.script.rhino.WindowWrapper$GetURLFunctionWrapper.getURLDone(Unknown
Source)
at org.apache.batik.bridge.ScriptingEnvironment$7.run(Unknown Source)
at org.apache.batik.util.RunnableQueue.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)