I'm using FOP 0.20.4 to transform SVG into PDF from a jsp page (wrote my own JSP tag to invoke FOP).  The content uses url(#id) in various places (example below).
<svg:pattern id="sbBgPatt" preserveAspectRatio="xMidYMid meet" width="2" height="2" patternUnits="userSpaceOnUse" shape-rendering="optimizeSpeed">
<svg:rect x="0" y="0" width="2" height="2" fill="white"/>
<svg:rect x="0" y="0" width="1" height="1" fill="rgb(102,204,255)"/>
<svg:rect x="1" y="1" width="1" height="1" fill="rgb(102,204,255)"/>
</svg:pattern>
<svg:rect fill="url(#sbBgPatt)" height="16" width="716" x="105" y="532"/>

If I execute FOP from a command line, no errors occur.  However from within my JSP environment, I get an exception while it is trying to process the url.  If I remove all usages of url(#id), then everything works fine.

My question is as follows - Is url(#id) supported at this time and if not, is there another syntax that is working?  I believe FOP 0.20.4 ships with Batik 1.5beta2.

java.lang.NullPointerException

        at java.net.URL.<init>(URL.java:366)
        at java.net.URL.<init>(URL.java:329)
        at java.net.URL.<init>(URL.java:321)
        at java.net.URL.<init>(URL.java:252)
        at java.net.URL.<init>(URL.java:275)
        at org.apache.batik.util.ParsedURLData.buildURL(Unknown Source)
        at org.apache.batik.util.ParsedURLData.openStreamInternal(Unknown Source)
        at org.apache.batik.util.ParsedURLData.openStream(Unknown Source)
        at org.apache.batik.util.ParsedURL.openStream(Unknown Source)
        at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown  Source)
        at org.apache.batik.bridge.DocumentLoader.loadDocument(Unknown Source)
        at org.apache.batik.bridge.URIResolver.getNode(Unknown Source)
        at org.apache.batik.bridge.URIResolver.getElement(Unknown Source)
        at org.apache.batik.bridge.BridgeContext.getReferencedElement(Unknown Source)
        at org.apache.batik.bridge.PaintServer.convertURIPaint(Unknown Source)
        at org.apache.batik.bridge.PaintServer.convertPaint(Unknown Source)
...

TIA,
Larry Mason

Reply via email to