This is exactly what i did.
I subclassed SVGImageElementBridge to get the SVG Document instead of a GVT Tree, if the image element is SVG content.
Since I assumed that the SVGImageElementBridge objects are volatile (could not figure out how to retrieve them once the GVT is built), i modified the SVGImageElementBridge.buildImageGraphicsNode(BridgeContext ctx, org.w3c.dom.Element e) to return a Node instead of a GVT, and only return it if the stream is a XML document. (Returns null otherwise).
I then get the SVGSVGElement from the returned SVGDocument (in Node format) and appendChild it into the base document, assigning width-height atttributes. This is working fine now, and it allows to merge-consolidate multiple SVG documents into a single File.
Andres.
On Nov 7, 2004, at 10:28 AM, Thomas DeWeese wrote:
Tonny Kohar wrote:
I want to get the SVGDocument of otherImage.svg, from within the SVGDocumentI am not sure, how about using correspondingElement or
from the outermost SVG (loaded in the JSVGCanvas).
correspondingUseElement method from SVGElementInstance.
You can't get the image subtree with these commands.
Currently there isn't an SVG specification on how to do this.
You can do it with ugly Batik specific stuff.
If you get the SVGContext from the image element
(batik.dom.svg.SVGOMElement.getSVGContext()). This will be
an batik.bridge.SVGImageElementBridge. This has a member called
'imgDocument' - currently this is protected, so you might have to
add a getter (I'll add one to CVS). This is the SVG Document
(assuming the image element references SVG.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]