jOOX - an early prototype for a jQuery port to Java
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" $(document).find("orders") .children() .eq(4) .append("<paid>true</paid>"); // Find those orders that are paid and flag them as "settled" $(document).find("orders") .children() .find("paid") .after("<settled>true</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.