I am the founder and CEO of Data Geekery GmbH, located in Zurich, Switzerland. With our company, we have been selling database products and services around Java and SQL since 2013. Ever since my Master's studies at EPFL in 2006, I have been fascinated by the interaction of Java and SQL. Most of this experience I have obtained in the Swiss E-Banking field through various variants (JDBC, Hibernate, mostly with Oracle). I am happy to share this knowledge at various conferences, JUGs, in-house presentations and on our blog. Lukas is a DZone MVB and is not an employee of DZone and has posted 241 posts at DZone. You can read more from them at their website. View Full User Profile

jOOX - an early prototype for a jQuery port to Java

  • submit to reddit

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.

Published at DZone with permission of Lukas Eder, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)