You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Stephane MOR <st...@yahoo.fr> on 2001/12/12 02:21:04 UTC

Document output

Hello, 

I would like to know how to merge a template and a context in a org.w3c.dom.Document, so that I can parse it again using another tool.

Exactly, I'd like to process a "templated" SVG file (a SVG file with Velocity instructions), retrieve the result as a Document which I would feed Batik with, so that it is rendered on screen.

Could anyone please tell me how this can be done ?

Thanks, 
Stephane

Re: Document output

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 12/11/01 8:21 PM, "Stephane MOR" <st...@yahoo.fr> wrote:

> Hello, 
> 
> I would like to know how to merge a template and a context in a
> org.w3c.dom.Document, so that I can parse it again using another tool.
> 
> Exactly, I'd like to process a "templated" SVG file (a SVG file with Velocity
> instructions), retrieve the result as a Document which I would feed Batik
> with, so that it is rendered on screen.
> 
> Could anyone please tell me how this can be done ?

If I understand the question, you could take the template (SVG file with
VTL), render it into a StringWriter, then use that stringwriter to feed into
JDOM or dom4j to get a Document (not sure if they can produce a
org.w3c.dom.Document, but you get the idea?) and then use that Document as
you need to...

Once you get the Writer back from Velocity, you can use it like any other
char stream...

-- 
Geir Magnusson Jr.                       geirm@optonline.net
System and Software Consulting
You're going to end up getting pissed at your software
anyway, so you might as well not pay for it. Try Open Source.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>