Stream XML for Java is a domain specific language for streaming well-formed XML documents.
Strongly typed
Domain specific language (DSL)
Well-formed XML
Scalable through streaming
Implement AJAX request
Build XHTML components
Stream XHTML pages
Implement JSP tag libraries
Mockable through interfaces
Stream XML using Java.
No need to use templates. Use POJO's to stream XML.
Its a simple but powerfull API with a small footprint.
Open-source software released under the Apache 2 license.
Stream an unlimited number of orders to XML without going out-of-memory. The XML is streamed order per order.
OutputStreamWriter osw;//the output stream writer
Iterable<Order> orders;//the unlimited count of orders
Element ordersXml = ElementFactory.getInstance().root("orders");
for(Order order:orders) {
Element orderXml = ordersXml.elem("order");
orderXml.attr("id", order.number);
orderXml.elem("number").pcdata(order.number);
orderXml.elem("customer").pcdata(order.customer);
orderXml.stream(osw);//stream order
}
ordersXml.stream(osw);//stream end tags
Stream XHTML
OutputStreamWriter osw;//the output stream writer
Element html = ElementFactory.getInstance().root("html");
Element head = html.elem("head").attr("class", "head");
head.elem("link").attr("type", "text/css");
Element body = html.elem("body");
body.elem("h1").pcdata("Hello World!");
html.stream(osw);//stream everything at once