A better way to do XML in Java
Posted
by jboyd
on Stack Overflow
See other posts from Stack Overflow
or by jboyd
Published on 2010-04-22T19:59:33Z
Indexed on
2010/04/22
20:23 UTC
Read the original article
Hit count: 260
There are a lot of questions that ask the best XML parser, I am more interested in what is the XML parser that is the most like Groovy for Java?
I want:
SomeApiDefinedObject o = parseXml( xml );
for( SomeApiDefinedObject it : o.getChildren() ) {
System.out.println( it.getAttributes() );
}
The most important things are that I don't want to create an object for every type of filed, I'd rather just deal with them all as strings, and that building the XML doesn't require any converters or anything, just a simple object that is already defined
If you have used the Groovy XML parser, you will know what I'm talking about
Alternatively, would it be better for me to just use Groovy from Java?
© Stack Overflow or respective owner