xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thierry Kormann <Thierry.Korm...@sophia.inria.fr>
Subject Re: Can I embed SVG elements in other documents?
Date Thu, 14 Dec 2000 07:08:23 GMT

> I would like to use Batik as a library in my application.  I have an XML
> file with my own DTD or XML Schema and I would like to include svg elements
> in it.  Then after parsing I would like to selectively build GraphicsNode
> objects for some of the svg elements and render them directly to a
> Graphics2D.  So my XML file would look something like:

I think Batik can handle this case. I see two possible solutions that should 
work at this time.

1. Extract the XML document fragment in the SVG namespaces and ask batik to 
parse and build the subtree. Then use the JSVGCanvas.setSVGDocument method.

2. Build the appropriate DOM subtree for the SVG document fragment using the 
Batik SVG DOM implementation and then use the GVTBuilder implementation to 
build GraphicsNode and at last call the JSVGCanvas.setRootNode method.

> Maybe using the Xerces XML Schema and namespace features so that svg
> elements can be placed in some other document type?

Batik also provides a generic implementation of the W3C recommendation DOM 
Level2 and handles namespaces. It's up to you but you have to use namespaces if 
you want to manage/mix multiple XML grammars.

PS: Notice that there is a public mailing list fir users: 
batik-users@xml.apache.org

Regards,
Thierry.

-- 
Thierry Kormann
email: Thierry.Kormann@sophia.inria.fr  http://www.inria.fr/koala/tkormann/
Koala/Dyade/Bull @ INRIA - Sophia Antipolis






Mime
View raw message