You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by George Armhold <ar...@cs.rutgers.edu> on 2004/08/27 14:29:11 UTC

using standard JRE XML parsers instead of xerces

Hi, some time ago I posted the following message asking about running 
Batik with the standard java XML parsers instead of xerces.  Can anyone 
suggest what might be wrong?  I'm sure I'm missing something simple like 
an additional property definition.

Thanks

Re: using standard JRE XML parsers instead of xerces

Posted by George Armhold <ar...@cs.rutgers.edu>.
Thomas DeWeese wrote:

 > I think the problem is the xml:base, xml:space etc that the SVG DTD
 > defines.  You might try adding
 > xmlns:xml="http://www.w3.org/XML/1998/namespace"

Oops... evidently I've not had enough coffee yet today because I sent
you the wrong file.  Sorry to waste your time with that, but you seem
to have found the problem in spite of my mistake.

The file that Batik is complaining about is in fact some (edited)
output from inkscape.  And it turns out that the *presence* of the
xmlns:xml namespace is what's causing the problem.  If I remove that
line, batik can read it without xerces.

Here is the correct file that batik complains about.


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<!-- (with some manual editing by George Armhold) -->
<svg
    id="svg1"
    sodipodi:version="0.32"
    inkscape:version="0.38.1"
    width="8in"
    height="5in"
    viewBox="0 0 841 595"
    preserveAspectRatio="xMidYMid meet"
    sodipodi:docname="lecture123.svg"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:cc="http://web.resource.org/cc/"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:xml="http://www.w3.org/XML/1998/namespace"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    sodipodi:docbase="/home/armhold/java/elearning/svg">

<g>

</g>

</svg>


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: using standard JRE XML parsers instead of xerces

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi George,

    I think the problem is the xml:base, xml:space etc
that the SVG DTD defines.  You might try adding
xmlns:xml="http://www.w3.org/XML/1998/namespace"

    Although from memory this should not be required by
a conformant XML Parser.

George Armhold wrote:

> Thomas DeWeese wrote:
> 
>  > It looks to me like someone has an xmlns:xml in the document.  Since
>  > I think the xml namespace is always defined for namespace aware
>  > processors this might be the problem.  I don't know who is doing
>  > this however (I think we do some stuff with the xml namepsace but I
>  > don't think we define the namespace this way).
> 
>  >    Can you show the problem document, or element?
> 
> Sure, it's simple enough:
> 
> <?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">
> <svg width="8in" height="5in"
>      viewBox="0 0 25400 19100"
>      preserveAspectRatio="xMidYMid meet"
>      xmlns:xlink="http://www.w3.org/1999/xlink"
>      xmlns="http://www.w3.org/2000/svg"
>      version="1.0">
> 
> <g>
> 
> </g>
> 
> </svg>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: using standard JRE XML parsers instead of xerces

Posted by George Armhold <ar...@cs.rutgers.edu>.
Thomas DeWeese wrote:

 > It looks to me like someone has an xmlns:xml in the document.  Since
 > I think the xml namespace is always defined for namespace aware
 > processors this might be the problem.  I don't know who is doing
 > this however (I think we do some stuff with the xml namepsace but I
 > don't think we define the namespace this way).

 >    Can you show the problem document, or element?

Sure, it's simple enough:

<?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">
<svg width="8in" height="5in"
      viewBox="0 0 25400 19100"
      preserveAspectRatio="xMidYMid meet"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns="http://www.w3.org/2000/svg"
      version="1.0">

<g>

</g>

</svg>


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: using standard JRE XML parsers instead of xerces

Posted by Thomas DeWeese <Th...@Kodak.com>.
George Armhold wrote:

> Hi, some time ago I posted the following message asking about running 
> Batik with the standard java XML parsers instead of xerces.  Can anyone 
> suggest what might be wrong?  I'm sure I'm missing something simple like 
> an additional property definition.

    It looks to me like someone has an xmlns:xml in the document.
Since I think the xml namespace is always defined for namespace
aware processors this might be the problem.  I don't know who
is doing this however (I think we do some stuff with the xml
namepsace but I don't think we define the namespace this way).

    Can you show the problem document, or element?

> 
> Thanks
> 
> ------------------------------------------------------------------------
> 
> Subject:
> Re: Java applet for browser integration using Batik
> From:
> George Armhold <ar...@cs.rutgers.edu>
> Date:
> Wed, 11 Aug 2004 14:27:45 +0200
> To:
> Batik Users <ba...@xml.apache.org>
> 
> To:
> Batik Users <ba...@xml.apache.org>
> 
> 
> Thomas DeWeese wrote:
> 
>  > There are a couple of ways to do this.  One is to override
>  > bridge.UserAgent.getXMLParserClassName to return the name of any
>  > SAX2 parser.
> 
> Hi Thomas.  I actually took the approach of including my own
> org/apache/batik/util/resources/XMLResourceDescriptor.properties in my
> project's jar file.
> 
>  > The default implementation looks at:
>  > batik/util/resources/XMLResourceDescriptor.properties for the
>  > "org.xml.sax.driver" property.  I think the JVM parser is
>  > "javax.xml.parsers.SAXParser"
> 
> That didn't work for me, I had to use
> org.apache.crimson.parser.XMLReaderImpl.  This seemed to work fine for
> part of my application.  However with one of our tools I get the
> following stacktrace.  Any idea what this could be about?  Is there
> some other resource I need to change?
> 
> 
> java.io.IOException: Illegal Namespace prefix: "xml".
>     at 
> org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:418) 
> 
>     at 
> org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:341) 
> 
>     at 
> org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:228) 
> 
>     at 
> edu.rutgers.elearning.scribble.ScribbleRecorder.<init>(ScribbleRecorder.java:99) 
> 
>     at edu.rutgers.elearning.presenter.Presenter.<init>(Presenter.java:196)
>     at edu.rutgers.elearning.presenter.Presenter.main(Presenter.java:1071)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
> 
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
> 
>     at java.lang.reflect.Method.invoke(Method.java:324)
>     at com.sun.javaws.Launcher.executeApplication(Launcher.java:837)
>     at com.sun.javaws.Launcher.executeMainClass(Launcher.java:797)
>     at com.sun.javaws.Launcher.continueLaunch(Launcher.java:675)
>     at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:390)
>     at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:199)
>     at com.sun.javaws.Launcher.run(Launcher.java:167)
>     at java.lang.Thread.run(Thread.java:534)
> 
> 
> Thanks.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org