You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Saimon Moore <sa...@yahoo.co.uk> on 2001/07/25 21:39:56 UTC
Problems: Texen
Hi all,
I've been trying to test Texen and have succesfully compiled a very Basic
Texen task. Build.xml and build.properties and the templates are also set up
properly I think as when ant executes init it goes through the task, prints
outs the comments, executes the Texen task (I have code to verify that it's
being executed) succesfully.
However, no files are generated because velocity can't seem to find the
Generator object. I was looking around in TexenTask.java and I couldn't see
where $generator is being added to the context. There's something about
$generator explicitly not being added to the context in the comment above the
populateInitialContext() method
Actually while my task is running I loop through all the keys in the context
and the only one there is the one I put in it. Namely a JDOM document.
Any ideas about, where $generator is. I based my code on the Torque
TexenTasks and there's no mention in there of adding Generator to the context.
>From Velocity Log:
org.apache.velocity.runtime.exception.ReferenceException: reference :
template = Control.vm [line 6,column 4] : $outputFile is not a valid
reference.
org.apache.velocity.runtime.exception.ReferenceException: reference :
template = Control.vm [line 7,column 4] :
$generator.parse("ejb/planet.vm",$outputFile,"planet",$planet) is not a valid
reference.
>From generated report:
//I don't know why velocity is complaining about $outputFile not being a
valid reference becuase it seems to be recognizing it ok here
$outputFile = "a.java"
$generator.parse("planet.vm",$outputFile,"planet",$planet)
$outputFile = "b.java"
$generator.parse("planet.vm",$outputFile,"planet",$planet)
$outputFile = "c.java"
$generator.parse("planet.vm",$outputFile,"planet",$planet)
Thanks in advance...
P.S. What would be preferable to use if you wanted text generation from an
xml file ? Anakia or Texen? What about using Texen and adding a JDOM document
parsed via SAXBuilder? Which is what I'm doing....
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com