Over a million developers have joined DZone.

jOOX - an early prototype for a jQuery port to Java


jQuery is probably one of the most successful API's for the navigation and manipulation of XML data. Unfortunately, that library only exist in JavaScript, mainly for the handling of HTML data. Nevertheless, it would be very well suited as a wrapping layer on top of the Java DOM API, for instance. Incredibly, no one seems to have ported this library to other languages, except maybe for GQuery, which seems to be quite tightly coupled to GWT:


I have given this a shot and hacked the most important traversing and manipulation functionality together in a rapid prototype (without all the fancy selectors, for now). This prototype looks quite promising:


Essentially, jOOX code will look similar to this:

// Find the order at index four and add an element "paid"

// Find those orders that are paid and flag them as "settled"


I think it is about time, that Java developers can manipulate XML with the ease of a jQuery programmer. We have suffered a lot with the standard DOM API. History has not brought up any real alternatives (dom4j, JDOM). While their API's seem a bit slimmer, they do not really outperform Xerces:


So let's try afresh with this sexy fluent-ness. Contributions and other feedback welcome! :-)

Note: I am aware of these two projects:

 Unfortunately, both of them are tightly coupled with HTML/CSS. They might inspire jOOX for future developments, though.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}