velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Williams <>
Subject wrapping XML document as JavaBeans?
Date Wed, 03 Oct 2001 01:04:13 GMT
Say I have the following XML document:


I want to make the data therein available to a Velocity template.  I could
do what Anakia does, and simply place a JDOM representation in the
Context.  However, then I'd end up with template expressions like


when I'd much rather write:


I could create explicit model JavaBean objects, like Torque does, but I
might want to deal with lots of different XML documents, and don't want to
have to generate a set of JavaBeans for each DTD.

Are there any other options?  Would it be feasible to create a generic
wrapper-ojbect that allows <field><name>id</name></field> to be accessed
"$" ?

cheers, Mike

View raw message