jOOX是JavaObjectOrientedXML的缩写(尽管我觉得这名字有点猥琐),是org.w3c.dom包的简单封装。用于XML文档的创建以及DOM的操作,其思路很像jQuery。
示例代码:
// Find the order at index 4 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>");// Add a complex element$(document).find("orders").append( $("order", $("date", "2011-08-14"), $("amount", "155"), $("paid", "false"), $("settled", "false")).attr("id", "13");
评论