[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

SVG with FOP help

Subject: SVG with FOP help
From: "tpass001" <tpass001@xxxxxxxxxxx>
Date: Mon, 26 Aug 2002 08:35:51 -0500
fop help
I have used FOP to create and display all the format types like PDF, MIF,
PCL etc. except SVG and I must say that I am impressed with the software.

I need some help with the SVG Renderer. I am not sure that I am doing this
right.The code that I use is

try {
  String xsl = new String(getServletContext().getRealPath("/") +
"webSVG.xsl");
  ByteArrayOutputStream out = new ByteArrayOutputStream();
   res.setContentType("image/svg+xml");
   Driver driver =new Driver();
   driver.setOutputStream(out);
   driver.setRenderer(Driver.RENDER_SVG);
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xslSource = new StreamSource(new URL("file:" +
xsl).openStream());
    javax.xml.transform.Transformer transformer =
tFactory.newTransformer(xslSource);
    Source xmlSource = new StreamSource(new StringReader(xml));
     transformer.transform(xmlSource, new
SAXResult(driver.getContentHandler()));
    cat.debug("RMSServlet:transformToSVG, fails b4 this line");
    byte[] content = out.toByteArray();
    res.setContentLength(content.length);
    res.getOutputStream().write(content);
   res.getOutputStream().flush();
 } catch (Exception ex) {
   throw new ServletException(ex);
    }

When I try this I get the java.lang.NoClassDefFoundError:
org/w3c/dom/svg/SVGDocument error, though I have the batik.jar in my
classpath.

I am not sure that I am using the right xslt. Does anyone have links to
online examples of transforming xml to svg using xslt. my xml is very basic
and does not need formatting or anything.

Help will be very much appriciated.

Thanks

TP

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.