velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Israel Strobel" <stro...@egadgets.de>
Subject AW: wrapping XML document as JavaBeans?
Date Wed, 03 Oct 2001 17:48:17 GMT
Well I'm actually using Velocity for XML Transformation, rather then using
XSLT. Therefore I have a tool which converts an XML Document, to a DOM
Object and then builds an Hashtable tree out of the DOM Object. So you can
simply write:
	$person.address.country
Then I use an empty XML Document as template, and fill it up with Velocity.

I can give you the code if you're interessted.

Greets,
Israel Strobel

> -----Ursprungliche Nachricht-----
> Von: mikew@byrd.int.cortexebusiness.com.au
> [mailto:mikew@byrd.int.cortexebusiness.com.au]Im Auftrag von Mike
> Williams
> Gesendet: Mittwoch, 3. Oktober 2001 03:04
> An: velocity-user@jakarta.apache.org
> Betreff: wrapping XML document as JavaBeans?
>
>
> Say I have the following XML document:
>
>    <bean>
>      <name>UserInfo</name>
>      <field>
>        <name>id</name>
>        <type>int</type>
>      </field>
>      <field>
>        <name>name</name>
>        <type>java.lang.String</type>
>      </field>
>    </bean>
>
> 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
>
>   $field.getChild("name").getText()
>
> when I'd much rather write:
>
>   $field.name
>...


Mime
View raw message