xmlmapper:
java mapping of xml documents
SourceForge.net Logo

Description download howto

How to use the xmlmapper package ?

note: currently, the only xmlParser available is "XercesDom". It means that the parser that will be used to realize the mapping is DOM from Apache Xerces. The procedure to add new parsers is described here.

Generate the java source code realizing the mapping you want

xmlmapper.ClassBuilder is the object doing what you want.

You have two possibilities of using the ClassBuilder object depending if you want to use a properties file or not:
 

The properties file is usefull if you want someone to use this mapping without any knowledge of the ClassBuilder object. It also allows you to easily modify one characteristic of your generation without having to recompile any of your code.
 

Compile the generated classes and begin to use it in your code

 

Initialize your objects with the xml document values you want

xmlmapper.ClassPopulater is the object doing what you want.

Again, you have two options depending if you want to use a properties file or not:
 

the returned object is the root object from where you can access all objects. The children objects are stored in ArrayLists, attributes are stored in String and text (or CDATA) fields as String.
 

Write back XML !

xmlmapper.XmlBuilder is the object doing what you want.

There is only one method to use here:

It will generates the xml corresponding to the object (which should be part of the generated package) you gave as input to the given OutputStream.