Hi Roberto, > On Sat February 28 2009 7:25:25 am [email protected] wrote:
> > This document doesn't have any base URL so resolving > > URL's that aren't absolute will be a problem. Since your > > URL's are relative this is likely your problem. > > > > You could set the base URL on that document with > > batik.dom.svg.SVGOMDocument.setURLObject(URL). > > This will work fine if all your content is based off > > one URL. The other thing you could do is create a group > > and use the 'xml:base' attribute on the group to set the > > 'base' URL for resolution within that group. Roberto Villarreal <[email protected]> wrote on 02/28/2009 01:52:49 PM: > The first suggestion worked (haven't tried the second yet); thanks. Having > said that, this leaves me to believe the following: > > 1) An external SVG document, applied using either setURI() or > setSVGDocument(), "knows" what this base URL is (even when not specified in > the file) Right because it's specified when you load the document. > 2) A code-created SVG document does not "know" what the base URL unless told Well a code create SVG document doesn't have one since it wasn't created from a URL... > 3) Either: > a) the URL passed into setURLObject() is a "meta-attribute"; part of the > internal Batik data structures, but not part of the tree itself, or > b) if it is part of the tree, the PrettyPrinter does not display it, or > c) I have no idea what I'm talking about > > Am I correct on any or all of these? I guess I would consider it 'a' (you are a little unclear what 'part of the tree' means) of course using the 'xml:base' attribute makes it part of the DOM and the pretty printer would display it. One of the attributes of HTML/SVG is that it's pretty easy to move content around the Web this is facilitated by all references being relative to how you found the base document, if the base URL was 'hard coded' into the content this wouldn't be as easy.
