Hi,

I use your example test document and load it under Batik Squiggle, it
run fine.

You can query the doc URL base using the following code, to make sure it
is set in the intended path
svgDocument.getURL();

How do you convert the file URI, do you use Java file.toURL() ?
As far as I know file URI, start with file:/ eg: file:/c://something (on
Windows) and file:/home/something (on Unix), It is not file:something

Regards
Tonny Kohar

> I'm loading the existing document and it's not working.
> If I put the document in the working directory for example and the use an URL 
> "file:test.svg", it works. If the document is in a subfolder for example 
> "doc" 
> it doesn't work with URL "file:doc/test.svg". It turned out that the doc base 
> is 
> set to file:doc/, so it looks for urls in file:doc/doc/test.svg (if I put the 
> copy of the document there, everything is OK).
> 
> The test document is very simple:
> <?xml version="1.0" encoding="windows-1250" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
> "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
> <svg width="600" height="400" viewBox="0 0 600 400" 
> xmlns="http://www.w3.org/2000/svg"; version="1.1">
>    <desc>Example circle01 - circle filled with red and stroked with 
> blue</desc>
>    <defs>
>       <linearGradient x1="100"  gradientUnits="userSpaceOnUse" y1="200" 
> x2="500"
>            y2="400" id="id0">
>          <stop offset="0" stop-color="#EBE0FF"/>
>          <stop offset="0.101961" stop-color="#33CC33"/>
>          <stop offset="0.490196" stop-color="#FFFF00"/>
>          <stop offset="0.878431" stop-color="#FF0000"/>
>          <stop offset="1" stop-color="#EBE0FF"/>
>       </linearGradient>
>    </defs>
>    <circle cx="200" cy="200" r="100" fill="url(#id0)" stroke="blue" 
> stroke-width="10" />
> </svg>
> 
> The message is:
> org.apache.batik.bridge.BridgeException: file:doc/test.svg:25
> An I/O error occured while processing the URI:
> "file:doc/test.svg#id0"
> specified on the element <circle>
> 
>  at 
> org.apache.batik.bridge.BridgeContext.getReferencedElement(BridgeContext.java:638)
>  at org.apache.batik.bridge.PaintServer.convertURIPaint(PaintServer.java:348)
>  at org.apache.batik.bridge.PaintServer.convertPaint(PaintServer.java:259)
>  at org.apache.batik.bridge.PaintServer.convertFillPaint(PaintServer.java:228)
>  at 
> org.apache.batik.bridge.PaintServer.convertFillAndStroke(PaintServer.java:146)
>  at 
> org.apache.batik.bridge.SVGShapeElementBridge.createShapePainter(SVGShapeElementBridge.java:113)
>  at 
> org.apache.batik.bridge.SVGCircleElementBridge.createShapePainter(SVGCircleElementBridge.java:124)
>  at 
> org.apache.batik.bridge.SVGShapeElementBridge.buildGraphicsNode(SVGShapeElementBridge.java:87)
>  at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:210)
>  at org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:161)
>  at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:77)
>  at org.apache.batik.swing.svg.GVTTreeBuilder.run(GVTTreeBuilder.java:95)
> 
> I set the URI with JSVGCanvas setURI method
> or with
> SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
> doc = f.createDocument(uri, reader);


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to