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?
Expand|Select|Wrap|Line Numbers
- // 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