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 B Wood <bw...@actsi.com> on 2001/12/12 20:23:57 UTC
org.apache.batik.bridge.BridgeException
I am getting different results when trying to display the same svg document using JSVGCanvas.setSVGDocument() and JSVGCanvas.setURI().
I am using Xalan to apply a stylesheet to an xml file which results in an SVGDocument object:
SVGDOMImplementation impl = (SVGDOMImplementation) SVGDOMImplementation.getDOMImplementation();
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
SVGDocument doc = (SVGDocument) impl.createDocument(svgNS, "svg", null);
Source xmlSrc = new StreamSource(xmlURI);
Source xslSrc = new StreamSource(stylesheetURI);
DOMResult svgResult = new DOMResult(doc.getDocumentElement());
Transformer transformer = tFac.newTransformer(xslSrc);
transformer.transform(xmlSrc,svgResult);
Then sending the SVGDocument object (doc) to the JSVGCanvas, equivalent to:
JSVGCanvas canvas = new JSVGCanvas();
canvas.setSVGDocument((SVGDocument) doc);
I consistently get this result (even with different svg data):
org.apache.batik.bridge.BridgeException: null:-1
The attribute 'd' of the element <path> is required
at org.apache.batik.bridge.SVGPathElementBridge.buildShape(Unknown Source)
at org.apache.batik.bridge.SVGShapeElementBridge.createGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
at org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown Source)
For debugging purposes I took that SVGDocument and used Xalan's default copying behavior to send it to a file. Then I used canvas.setURI() to view the SVG from that file, and it rendered without any errors.
Why am I getting different results?
Attached is that svg file: output.svg
I am using batik 1.1, xalan 2.1.0, and crimson 1.1.3 on jdk 1.3.0.
Re: org.apache.batik.bridge.BridgeException
Posted by B Wood <bw...@actsi.com>.
I have tried it with Batik 1.1.1 (last time I built it was 12/20/01), and I got the same result. I have tried different combinations of parsers. I haven't tried debugging into the GVTBuilder. Has anyone else had similar problems? I can't be the only one trying to use Xalan to produce SVG documents.
On Mon, 28 Jan 2002 15:21:16 +0100, Thierry Kormann wrote:
>On Wednesday 12 December 2001 20:23, B Wood wrote:
>> I am getting different results when trying to display the same svg
>>document
>> using JSVGCanvas.setSVGDocument() and JSVGCanvas.setURI().
>>
>> I am using Xalan to apply a stylesheet to an xml file which
>>results in an
>> SVGDocument object:
>>
>> SVGDOMImplementation impl = (SVGDOMImplementation)
>> SVGDOMImplementation.getDOMImplementation(); String svgNS =
>> SVGDOMImplementation.SVG_NAMESPACE_URI;
>> SVGDocument doc = (SVGDocument) impl.createDocument(svgNS,
>>"svg", null);
>>
>> Source xmlSrc = new StreamSource(xmlURI);
>> Source xslSrc = new StreamSource(stylesheetURI);
>> DOMResult svgResult = new DOMResult(doc.getDocumentElement());
>>
>> Transformer transformer = tFac.newTransformer(xslSrc);
>> transformer.transform(xmlSrc,svgResult);
>>
>> Then sending the SVGDocument object (doc) to the JSVGCanvas,
>>equivalent to:
>> JSVGCanvas canvas = new JSVGCanvas();
>> canvas.setSVGDocument((SVGDocument) doc);
>>
>> I consistently get this result (even with different svg data):
>>
>> org.apache.batik.bridge.BridgeException: null:-1
>> The attribute 'd' of the element <path> is required
>> at
>>org.apache.batik.bridge.SVGPathElementBridge.buildShape(Unknown
>>Source)
>> at
>>
>>org.apache.batik.bridge.SVGShapeElementBridge.createGraphicsNode(Unk
>>nown
>> Source) at
>>org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
>> Source) at
>>org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
>> Source) at
>>org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
>> Source) at
>>org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
>> Source) at
>>org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
>> Source) at
>>org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
>> Source) at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
>> at org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown Source)
>>
>> For debugging purposes I took that SVGDocument and used Xalan's
>>default
>> copying behavior to send it to a file. Then I used
>>canvas.setURI() to view
>> the SVG from that file, and it rendered without any errors.
>>
>> Why am I getting different results?
>>
>> Attached is that svg file: output.svg
>>
>> I am using batik 1.1, xalan 2.1.0, and crimson 1.1.3 on jdk 1.3.0.
>
>I have no idea :( Do you still have the bug in batik1.1.1 ?
>
>
>Thierry.
>
>---------------------------------------------------------------------
>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: org.apache.batik.bridge.BridgeException
Posted by Thierry Kormann <tk...@ilog.fr>.
On Wednesday 12 December 2001 20:23, B Wood wrote:
> I am getting different results when trying to display the same svg document
> using JSVGCanvas.setSVGDocument() and JSVGCanvas.setURI().
>
> I am using Xalan to apply a stylesheet to an xml file which results in an
> SVGDocument object:
>
> SVGDOMImplementation impl = (SVGDOMImplementation)
> SVGDOMImplementation.getDOMImplementation(); String svgNS =
> SVGDOMImplementation.SVG_NAMESPACE_URI;
> SVGDocument doc = (SVGDocument) impl.createDocument(svgNS, "svg", null);
>
> Source xmlSrc = new StreamSource(xmlURI);
> Source xslSrc = new StreamSource(stylesheetURI);
> DOMResult svgResult = new DOMResult(doc.getDocumentElement());
>
> Transformer transformer = tFac.newTransformer(xslSrc);
> transformer.transform(xmlSrc,svgResult);
>
> Then sending the SVGDocument object (doc) to the JSVGCanvas, equivalent to:
> JSVGCanvas canvas = new JSVGCanvas();
> canvas.setSVGDocument((SVGDocument) doc);
>
> I consistently get this result (even with different svg data):
>
> org.apache.batik.bridge.BridgeException: null:-1
> The attribute 'd' of the element <path> is required
> at org.apache.batik.bridge.SVGPathElementBridge.buildShape(Unknown Source)
> at
> org.apache.batik.bridge.SVGShapeElementBridge.createGraphicsNode(Unknown
> Source) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
> Source) at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
> Source) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
> Source) at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
> Source) at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown
> Source) at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown
> Source) at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
> at org.apache.batik.swing.svg.GVTTreeBuilder.run(Unknown Source)
>
> For debugging purposes I took that SVGDocument and used Xalan's default
> copying behavior to send it to a file. Then I used canvas.setURI() to view
> the SVG from that file, and it rendered without any errors.
>
> Why am I getting different results?
>
> Attached is that svg file: output.svg
>
> I am using batik 1.1, xalan 2.1.0, and crimson 1.1.3 on jdk 1.3.0.
I have no idea :( Do you still have the bug in batik1.1.1 ?
Thierry.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org