This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: XML API for object import/export?


rhug has ports of many of the standard xml tools - xerces, xalan, etc.

however, if you're after simplicity, you could check out http://javadata.sourgeforge.net - it's a different point of view, very small and self-contained, and very much attuned to the notion of self-organizing objects.

javadata uses its own namespace-aware parser. i think there is one reference to sax in the whole package, and the file containing it can be removed for compilation under gcj, since you can use the QuikInputObjectFactory instead. no other packages or .jar files outside of jdk1.3 are referenced.

having your objects be able to build themselves from xml is a matter of implementing some simple interfaces. Tagged.Input, Attrs.Input and Children.Input have one method each, and suffice for an object that corresponds to an xml element with attributes and children.

there's more, lots more, but we're just talking xml input here.

Paul Gear wrote:

Hi folks,

Thanks for all your helpful answers to my questions so far.  I have one
more area that's really confusing me at the moment: XML.  Apologies if
this is off-topic.

I'd like to be able to import and export some specific classes in my
application via XML.  I don't necessarily need this for generalised
serialisation (although that wouldn't be a bad thing), but as a way of
getting objects into & out of my system.

The number of options that sit in the intersection of Java and XML seems
to me to be enormous: SAX, DOM, JAXB, JAXP, Xerces, JDOM, dom4j, etc.

My question is: what is the most appropriate API which:

- will enable me to parse an XML file and create Java objects from the
results

- is simple (preferably)

- is well-supported under GCJ

- is the "right direction" to go in terms of standards, and where GCJ is
likely to head in the future

From my reading of the documentation, i'm guessing that DOM is not the
most appropriate way to go, since i'm not really interested in general
manipulation of XML documents, but simply using them as a transport
mechanism for objects, but i'm not really sure.

Can anyone offer some guidance in this department?




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]