Hi!

2009/9/3 <[email protected]>

>
> Hi Mathieu,
>
> Mathieu Pedrero <[email protected]> wrote on 09/03/2009 05:06:55
> AM:
>
> >     public Molasson() {
>
> > // I add this document to the canvas, and the canvas to the panel.
> >         canvas.setDocument(document);
> >         jPanel1.add(canvas);
>
>     It's not likely to be the problem, but it's _much_ better to
> add the canvas to the panel before you set the document on it.
>
> >         String documentString =
> DOMUtilities.getXML(document.getDocumentElement());
> >
> >         Document document2 = (Document)
> DOMUtilities.parseXML(documentString,null,null,null,null,f);
>
>     Can I suggest, you use the following instead:
>
>          Document document2 = (Document)
> DOMUtilities.parseXML(documentString,null,
>
>        jfc.getSelectedFile().toURI().toString(),null,null,f);
>
>     This will ensure the document as a 'base URI' associated with it
> in case it needs to resolve relative URL's.
>
>
Thanks: This modification resolve my problem in the case of the code of my
precedent message...

But let's wonder... If I call the DOMUtilities.parseXML method to build a
document from a String which has not any URI? Here the URI we give to the
method is the one of the file chosen by the JFileChooser, but let's imagine
i wrote a string representing a svg doc on my keabord: What kind of URI
should I give to feed the parseXML method?


> > java.lang.NullPointerException
> >     at org.apache.batik.bridge.BridgeContext.
> > getInterpreter(BridgeContext.java:566)
>
>    Can you send what your version of the Batik Source has at
> BridgeContext.java line 566?
>

It's the following line:
                String[] mimeTypes = interpreter.getMimeTypes();

Thaks for your help!

Reply via email to