You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Geir Magnusson Jr <ge...@4quarters.com> on 2004/06/25 16:58:49 UTC

Re: Two input files to a template ?

On Jun 25, 2004, at 4:24 AM, Fitzpatrick, Niamh (CE) wrote:

>
> I'm using Anakia to parse the xml, so the steps I perform are:
>
> 1.	I build a JDOM document from the input xml file,
>
> 2.	create the VelocityContext,
>
> 3.	create the output file  (OutputStreamWriter)
> 4.	get the template to use,
>
> 5.	then call template.merge(context, writer)
>
> So this takes one input xml file, one template and outputs one (in my  
> case) html file.
>
> I would like to take in two separate xml files, one template and  
> output data from both xml files in one html file.
> Do you think this is possible ?

It's certainly possible, although I'm not sure how easy  w/ anakia,  
which is a rendering tool that takes one XML file and produces rendered  
output.  You could add a tool to use that lets you access a second XML  
document and use that in the rendering.

I'll also plug DVSL here.  There's no explicit mechanism for the second  
XML, but just parsing and dropping into the context should give you  
access w/ either Anakia or DVSL.

geir

> Thanks for your help.
> N.
>
>
>
> -----Original Message-----
> From: Tim Colson [mailto:tcolson@cisco.com]
> Sent: Thursday, June 24, 2004 7:34 PM
> To: 'Velocity Users List'
> Subject: RE: Two input files to a template ?
>
>
>
>>  Is there anyway I can get velocity to accept two input xml
>
>> files against which to merge the template?
>
>
> Please describe a bit more detail about how you're parsing the XML...
>
> Ex. Are you using one of the Velocity sub-projects like Anakia or DVSL?
>
> Or are you writing your own code to parse the XML?
>
>
> Timo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
> *********************************************************************** 
> ****************************
> The information in this email is confidential and may be legally  
> privileged.  Access to this email by anyone other than the intended  
> addressee is unauthorized.  If you are not the intended recipient of  
> this message, any review, disclosure, copying, distribution,  
> retention, or any action taken or omitted to be taken in reliance on  
> it is prohibited and may be unlawful.  If you are not the intended  
> recipient, please reply to or forward a copy of this message to the  
> sender and delete the message, any attachments, and any copies thereof  
> from your system.
> *********************************************************************** 
> ****************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: Two input files to a template ?

Posted by Tim Colson <tc...@cisco.com>.
> > I'm using Anakia to parse the xml, so the steps I perform are:
Ok, that makes the situation somewhat more understandable. :-)

My understanding is that Anakia was mostly built for 1 xml root to 1 output.
I think Anakia was originally used to convert a group of raw xml
documentation files into output.

Trying to get Anakia to combine two XML docs into one might be difficult,
but honestly I haven't done much with Anakia besides using it as an Ant task
in existing projects. Most of my XML+Velocity experience has been with
DVSL-- and that was still with 1 xml doc to 1 output.

What is in the two xml docs? 
Could they be 'combined' before being fed to the transformation process?

Cheers,
Timo



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org