Hi,
There were several posts about problems combining XSLT and batik in
batik-dev and comp.lang.java.softwaretools. I may have found a nice way
to solve the problem. I'm building a graphical viewer for an XML file
format using Xalan as transformation engine and batik's JSVGCanvas for
display:
Transformer myTransformer = transformerFactory.newTransformer(
new StreamSource("xml-to-svg.xsl") );
SVGOMDocument doc = new SVGOMDocument( null, svgDOMImplementation );
myTransformer.transform(
new StreamSource(inputFileName),
new DOMResult(doc) );
svgCanvas.setSVGDocument(doc);
It works, but there are a few flaws: In the xsl file I had to prefix
every SVG tag with a namespace specifier (like <svg:rect>). Hyperlinks
are not displayed at all, width and height attributes are ignored,
getSVGDocumentSize() returns Dimension(0,0) etc.
Strange thing is: If I write out the DOM to a temporary file like this:
Transformer nullTransformer = transformerFactory.newTransformer();
nullTransformer.transform(
new DOMSource(doc),
new StreamResult("temp.svg") );
svgCanvas.setURI("file://.../temp.svg");
everything works fine. Any ideas?
bye,
Hendrik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]