I'm looking around the web to find a quick little library to make writing to XML quick, clean and painless.
I'm getting confused by all the different options (JDOM, SAX, etc..)
My question is, do you know of a class or library (as close as possible to native java libraries, e.g. no huge library import) that i could use with the below pseudo code?
Thanks for any suggestions and pointers. I'm looking into JDOM, but want to hear your advice first.
Dan
I'm getting confused by all the different options (JDOM, SAX, etc..)
My question is, do you know of a class or library (as close as possible to native java libraries, e.g. no huge library import) that i could use with the below pseudo code?
Code:
// open document
SomeLibrary X = new SomeLibrary('myNewfile.xml');
X.addDTD('my.dtd');
X.addRoot('my_root_element');
forloop mydata {
Eelment E = X.addElement('myElement');
E.addAttribute('foo',myData[i].getFoo());
E.addNode('child',myData[i].getChild());
}
// write and close
X.write();
X.close();
Dan
Comment