xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kenneth B. Harwood" <run10ks...@comcast.net>
Subject BridgeException afer deepCloneDocument
Date Thu, 18 Aug 2005 05:37:15 GMT
After (deep) copying an SVG Document, I
attempt to render using setSVGDocument. I
receive a BridgeException associated with an invalid <linear gradient>.

The stackTrace shows that the Exception is being generated within AbstractSVGGradientElementBridge:

protected static List extractStop(Element paintElement,
                                      float opacity,
                                      BridgeContext ctx) {

        List refs = new LinkedList();
        for (;;) {
            List stops = extractLocalStop(paintElement, opacity, ctx);
            if (stops != null) {
                return stops; // stop elements found, exit
            }
            String uri = XLinkSupport.getXLinkHref(paintElement);
            if (uri.length() == 0) {
                return null; // no xlink:href found, exit
            }
            // check if there is circular dependencies
            SVGOMDocument doc = (SVGOMDocument)paintElement.getOwnerDocument();
            ParsedURL purl = new ParsedURL(doc.getURL(), uri);
            if (!purl.complete())
                throw new BridgeException(paintElement,
                                          ERR_URI_MALFORMED,   <--- EXCEPTION PROBABLY
HERE
                                          new Object[] {uri});

            if (contains(refs, purl)) {
                throw new BridgeException(paintElement,
                                          ERR_XLINK_HREF_CIRCULAR_DEPENDENCIES,
                                          new Object[] {uri});
            }
            refs.add(purl);
            paintElement = ctx.getReferencedElement(paintElement, uri);
        }
    }


I can understand a URI for the "original"
document but why should a URI be required
for its clone?  Apparently the URI for my
clone is ~null~. That seems perfectly
logical. But then extractStop() tries to
parse it!

What *should* a clone's URI truly be?
If someone can tell me that I'm sure
I can figure out when/where to set it.
 
I was getting errors like this a couple of
weeks ago; an input stream & transcoding
problem. The usergroup archive correctly
diagnosed my problem was related to
a screwy document URI. Can anyone point
me to some docus where I can get a grip 
on this SVG URI thing?


 - Ken H. 
Mime
View raw message