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

RE: XML + XSLT = SVG using FOP example needed...

Subject: RE: XML + XSLT = SVG using FOP example needed...
From: "Robert Koberg" <rob@xxxxxxxxxx>
Date: Mon, 26 Aug 2002 15:10:38 -0700
fop example
Hey,

I did not even know you could render SVG with FOP. I am new to SVG too (just got
my O'Reilly's SVG book 3 days ago :).

But, I don't understand why you would need to render. I thought SVG was just XML
that is displayed through some viewer. What do you get when you render it?

-Rob



> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of tpass001
> Sent: Monday, August 26, 2002 2:34 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  XML + XSLT = SVG using FOP example needed...
>
>
> Hey Robert,
>
> This small piece of code will make it clear.
>
> =================================================================
> 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()));
>   byte[] content = out.toByteArray();
>     res.setContentLength(content.length);
>      res.getOutputStream().write(content);
>   res.getOutputStream().flush();
>   cat.debug("transformToSVG, leaving");
>  } catch (Exception ex) {
>    throw new ServletException(ex);
>     }
> =================================================================
>
> So what I am trying to do is to have a multiple document output format for
> our application using FOP. We already output html using xslt and now using
> FOP we output in PDF, PCL, PS etc. all except SVG, which is what I am
> working on. I know that FOP can take SVG and embed it into the PDF like
> other image types. I do not want to do that. I want to be able to generate
> SVG by setting the  driver.setRenderer(Driver.RENDER_SVG); to give me the
> output.
>
> So now my question is that I have spent the entire day to find a simple xslt
> example that will take the xml source as an InputSource and the xslt to
> produce the svg. I am new to svg and do not know much about it yet. So, for
> right now even the most simplest of svgs will do :)
>
> TP.
>
>
> ----- Original Message -----
> From: "Robert Koberg" <rob@xxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Monday, August 26, 2002 4:12 PM
> Subject: RE:  XML + XSLT = SVG using FOP example needed...
>
>
> > Hi,
> >
> > I think you need to work on the concept a little :)
> >
> > First, you might want to come up with the SVG first.  Then you can see
> what data
> > you need to get it to that structure.
> >
> > From your description, I think you have things a little mixed up. You
> don't use
> > FOP to transform the XSL and XML. You can reference SVG in the FOP,
> though. Even
> > then, only very simple SVGs can be used.
> >
> > Do some searches to get more info to refine your ideas.
> >
> > best,
> > -Rob
> >
> > > -----Original Message-----
> > > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of tpass001
> > > Sent: Monday, August 26, 2002 1:45 PM
> > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > Subject:  XML + XSLT = SVG using FOP example needed...
> > >
> > >
> > > Hey ,
> > >
> > > i need help to find out where I can find one complete example to
> transform
> > > xml using xslt to svg using FOP. I have all the other output formats
> working
> > > so I know what I am doing is right. i have the xml ready and it is as
> simple
> > > as it can get, so i need a simple example xslt to convert it to svg for
> a
> > > proof of concept.
> > >
> > > my xml is something like
> > > <header>
> > >     <body>
> > >         <cell>cell data 1</cell>
> > >         <cell>cell data 2</cell>
> > >         <cell>cell data 3</cell>
> > >     </body>
> > > </header>
> > >
> > > The output I expect could be as simple as 3 lines which say
> > > cell data 1
> > > cell data 2
> > > cell data 3
> > >
> > > I would appreciate it, if someone could point me in the right direction.
> > >
> > > Thanks in advance.
> > >
> > > TP.
> > >
> > >
> > >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> > >
> >
> >
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>



 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.