[jdom-interest] RE: creating xml file fromjava object?

Andy Krumel andy at krumel.com
Mon Mar 5 09:15:49 PST 2001


Hi Ross,

Jato was designed to convert Java objects into JDOM documents and JDOM documents
into Java objects. Jato scripts are written in XML and describe the
transformations to perform. It supports the JavaBeans standard and invoking
complex methods and constructors. If you want more information you can go to
http://www.krumel.com/jato or email me. Jato is also hosted at SourceForge.

Here is a simple example to read and XML file, create a java.util.Properties
object, set the properties:

 <?xml version='1.0' encoding='UTF-8'?>
 <Jato:java-defs xmlns:Jato='http://www.krumel.com/jato' >
    <Jato:import>java.util.*</Jato:import>

    <Jato:translate elt='system-properties'>
       <Jato:object class='Properties' publish='props'>
          <Jato:on-elt name='property' action='invoke' method='setProperty'>
             <Jato:param type='string' path='@name'/>
             <Jato:param type='string' path='@value'/>
          </Jato:on-elt>
       </Jato:object>
    </Jato:translate>
 </Jato:java-defs>

Also, very soon it will have integrated XSL capabilities and generate dynamic
web pages.

Hope it helps,
Andy

> Can someone point me to the example that will show me how to take
> one xml file and generate another or how to store a java object of
> as an xml file?

> thanks
> Ross




More information about the jdom-interest mailing list