From: "Thomas DeWeese"
> > I'm currently using a Tomcat servlet to transform an uploaded SVG document. > > Once the document is transformed, I generate a PNG preview with Batik and > > then insert that image into the transformed document as a base64 encoding > > image; however, my preview image is always blank. [snip] > The problem almost certainly has to do with the base url of the document. > If you transcode from a stream it doesn't have one (unless you provide one to > the input stream). You can also provide an xml:base attribute to set the > base to resolve URL's against. > > Are you sure you aren't getting error messages of any sort? AFAIK, I'm catching all exceptions and none of them are firing and the transformed document is generated correctly, minus the blank preview. What's confusing me is that if I build the SVGDocument from the uploaded file (which is a string), I get a preview, but when I build from the results of the XSLT transform (again a string), I don't. I generate the SVGDocument with the exact same call (except for the string parameter, of course): SVGDocument svgDocument = new SAXSVGDocumentFactory( XMLResourceDescriptor.getXMLParserClassName() ).createSVGDocument( "http://localhost:8080/uploadTest/", new StringReader( some_string_here ) ); I'm not doubting your suggestion...I'm just trying to understand what I'm doing wrong. > > FWIW, I am serializing the transformed and then reparsing to create a new > > SVG document. My understanding from the code in Squiggle is that I have > > to do this. > > Pretty much, what you really need is for Xalan to create the output > document using our DOM implementation. You might find it faster to > deep clone the DOM into our implementation rather than serialize and parse. Do you by any chance know of an example showing this that I can look at? This is my first real foray into Java+XML and embarrassingly, I'm feeling a little lost at this point. Thanks for the help, Kevin KevLinDev - http://www.kevlindev.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]