[prev in list] [next in list] [prev in thread] [next in thread] 

List:       batik-dev
Subject:    RE: Reading in the SVG DOM
From:       "Peter Armstrong" <armstrong () intalio ! com>
Date:       2001-04-30 21:54:20
[Download RAW message or body]

RE: Reading in the SVG DOMIf you can't find the resource bundle, try copying
the full tree under the resources directory (org/apache/...) into your
CLASSPATH.  What I ended up doing is building a jar of the resources and
putting that jar in my CLASSPATH.

Hope this helps,
Peter Armstrong
  -----Original Message-----
  From: Jim Goodwin [mailto:JGoodwin@affinnova.com]
  Sent: Monday, April 30, 2001 2:14 PM
  To: 'batik-dev@xml.apache.org'
  Subject: RE: Reading in the SVG DOM


  Curt Arnold, Vincent Hardy:

  Thanks much for your prompt help to my previous email.

  Using Curt's suggestion I got a bit further.
  Now it is blowing out with the following exception:

  Can't find bundle for base name
org.apache.batik.dom.svg.resources.dtduris, locale en_US

  My program and the stack trace from the exception are attached below.

  I assume there is something I haven't installed right.
  Crimson is installed at least enough to instantiate XMLReaderImpl.
  But although I have org.apache.batik.dom.svg in my classpath,
  there is nothing below that (i.e. no "...resources.dtduris").

  Any ideas?

  Thanks in advance.
  Jim Goodwin

  [[[The program]]]
  package SVGReader;
  import org.w3c.dom.Document;
  import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
  import javax.xml.parsers.SAXParserFactory;
  import javax.xml.parsers.SAXParser;
  import org.xml.sax.XMLReader;

  /* An experiment in reading an SVG file as an SVG DOM object. */

  public class Experiment3

    public static void main(String args[])

      try


        SAXParserFactory saxFactory = SAXParserFactory.newInstance();
        SAXParser saxParser = saxFactory.newSAXParser();
        XMLReader reader = saxParser.getXMLReader();
        String xmlReaderClassName = reader.getClass().getName();
        System.out.println(xmlReaderClassName);

        SAXSVGDocumentFactory fact =
          new SAXSVGDocumentFactory(xmlReaderClassName);
        String path = "file:///C:\\SVGStuff\\Foo.svg";
        System.out.println("Trying: " + path);

        Document document = fact.createDocument(path);

        System.out.println("Succeeded");

      }
      catch (Exception e)

        System.out.println("Exception: " + e);
        System.out.println("Stack trace:");
        e.printStackTrace();
      }
    }
  }

  [[[[the output]]]]

  C:\JavaJim>java SVGReader.Experiment3
  java SVGReader.Experiment3
  org.apache.crimson.parser.XMLReaderImpl
  Trying: file:///C:\SVGStuff\Foo.svg
  Exception: java.io.IOException: Can't find bundle for base name
org.apache.batik.dom.svg.resources.dtduris, locale en_US

  Stack trace:
  java.io.IOException: Can't find bundle for base name
org.apache.batik.dom.svg.resources.dtduris, locale en_US
          at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFacto
ry.java:204)
          at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocument
Factory.java:95)
          at SVGReader.Experiment3.main(SVGReader/Experiment3.java:25)

  C:\JavaJim>


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>RE: Reading in the SVG DOM</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2869" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=314255221-30042001>If you 
can't find the resource bundle, try copying the full tree under the resources 
directory (org/apache/...) into your CLASSPATH.&nbsp; What I ended up doing is 
building a jar of the resources and putting that jar in my 
CLASSPATH.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=314255221-30042001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=314255221-30042001>Hope 
this helps,</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=314255221-30042001>Peter 
Armstrong</SPAN></FONT></DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
  <DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Jim Goodwin 
  [mailto:JGoodwin@affinnova.com]<BR><B>Sent:</B> Monday, April 30, 2001 2:14 
  PM<BR><B>To:</B> 'batik-dev@xml.apache.org'<BR><B>Subject:</B> RE: Reading in 
  the SVG DOM<BR><BR></DIV></FONT>
  <P><FONT size=2>Curt Arnold, Vincent Hardy:</FONT> </P>
  <P><FONT size=2>Thanks much for your prompt help to my previous email.</FONT> 
  </P>
  <P><FONT size=2>Using Curt's suggestion I got a bit further.</FONT> <BR><FONT 
  size=2>Now it is blowing out with the following exception:</FONT> </P>
  <P><FONT size=2>Can't find bundle for base name 
  org.apache.batik.dom.svg.resources.dtduris, locale en_US</FONT> </P>
  <P><FONT size=2>My program and the stack trace from the exception are attached 
  below.</FONT> </P>
  <P><FONT size=2>I assume there is something I haven't installed right.</FONT> 
  <BR><FONT size=2>Crimson is installed at least enough to instantiate 
  XMLReaderImpl.</FONT> <BR><FONT size=2>But although I have 
  org.apache.batik.dom.svg in my classpath,</FONT> <BR><FONT size=2>there is 
  nothing below that (i.e. no "...resources.dtduris").</FONT> </P>
  <P><FONT size=2>Any ideas? </FONT></P>
  <P><FONT size=2>Thanks in advance.</FONT> <BR><FONT size=2>Jim Goodwin</FONT> 
  </P>
  <P><FONT size=2>[[[The program]]]</FONT> <BR><FONT size=2>package 
  SVGReader;</FONT> <BR><FONT size=2>import org.w3c.dom.Document;</FONT> 
  <BR><FONT size=2>import org.apache.batik.dom.svg.SAXSVGDocumentFactory;</FONT> 
  <BR><FONT size=2>import javax.xml.parsers.SAXParserFactory;</FONT> <BR><FONT 
  size=2>import javax.xml.parsers.SAXParser;</FONT> <BR><FONT size=2>import 
  org.xml.sax.XMLReader;</FONT> </P>
  <P><FONT size=2>/* An experiment in reading an SVG file as an SVG DOM object. 
  */</FONT> </P>
  <P><FONT size=2>public class Experiment3 {</FONT> <BR><FONT size=2>&nbsp; 
  public static void main(String args[]) {</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp; try {</FONT> </P>
  <P><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SAXParserFactory saxFactory = 
  SAXParserFactory.newInstance();</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SAXParser saxParser = 
  saxFactory.newSAXParser();</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XMLReader reader = 
  saxParser.getXMLReader();</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String xmlReaderClassName = 
  reader.getClass().getName();</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  System.out.println(xmlReaderClassName);</FONT> </P>
  <P><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SAXSVGDocumentFactory fact = 
  </FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT size=2>new 
  SAXSVGDocumentFactory(xmlReaderClassName);</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String path = "<A 
  href="file:///C:\\SVGStuff\\Foo.svg" 
  target=_blank>file:///C:\\SVGStuff\\Foo.svg</A>";</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Trying: " + 
  path);</FONT> </P>
  <P><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Document document = 
  fact.createDocument(path);</FONT> </P>
  <P><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  System.out.println("Succeeded");</FONT> </P>
  <P><FONT size=2>&nbsp;&nbsp;&nbsp; }</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp; catch (Exception e) {</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Exception: " + 
  e);</FONT> <BR><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  System.out.println("Stack trace:");</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp; }</FONT> <BR><FONT size=2>&nbsp; } </FONT><BR><FONT 
  size=2>}</FONT> </P>
  <P><FONT size=2>[[[[the output]]]]</FONT> </P>
  <P><FONT size=2>C:\JavaJim&gt;java SVGReader.Experiment3</FONT> <BR><FONT 
  size=2>java SVGReader.Experiment3</FONT> <BR><FONT 
  size=2>org.apache.crimson.parser.XMLReaderImpl</FONT> <BR><FONT size=2>Trying: 
  <A href="file:///C:\SVGStuff\Foo.svg" 
  target=_blank>file:///C:\SVGStuff\Foo.svg</A></FONT> <BR><FONT 
  size=2>Exception: java.io.IOException: Can't find bundle for base name 
  org.apache.batik.dom.svg.resources.dtduris, locale en_US</FONT></P>
  <P><FONT size=2>Stack trace:</FONT> <BR><FONT size=2>java.io.IOException: 
  Can't find bundle for base name org.apache.batik.dom.svg.resources.dtduris, 
  locale en_US</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT 
  size=2>at 
  org.apache.batik.dom.util.SAXDocumentFactory.createDocument(SAXDocumentFactory.java:204)</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT size=2>at 
  org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:95)</FONT> 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT size=2>at 
  SVGReader.Experiment3.main(SVGReader/Experiment3.java:25)</FONT> </P>
  <P><FONT size=2>C:\JavaJim&gt;</FONT> </P></BLOCKQUOTE></BODY></HTML>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic