|
I created something similar to this a year or so ago, although I used a different approach which I think is much simpler and more practical for the user. Instead of requiring depth and width layout information embedded into the XML source document for the transformation into a static SVG image, my solution transforms an XML document into an SVG image with a specific document structure of nested g, line, and text elements that are dynamically positioned into tree with a recursive algorithm upon loading. The algorithm takes advantage of SVG's getComputedTextLength method to correctly position the nodes. Batik is able to rasterize the dynamic SVG image. The source code is released under the GPL. Instructions are available on the website: http://www.linguiste.org/syntax/tree/drawer/ |