Smooks v1.2 Examples

From Smooks

Jump to: navigation, search

These examples are provided with the distributution. See each example for execution instructions.



Name Keywords Description
xml-to-xml XML, FreeMarker, Mixing-DOM-&-SAX This example illustrates how Smooks (in conjunction with FreeMarker) can be used to perform an XML to XML transformation. This example can be used as the basis for any character based transformation i.e. not just XML to XML.
java-to-xml JavaSource, XML This example illustrates how Smooks can be used to transform a Java object graph to XML. It shows how to use a JavaSource to supply a Java object graph to Smooks for transformation.
xml-to-java XML, JavaResult An illustration of how Smooks can be used to extract data from an XML message, and use the data to populate an Object graph. It also shows how this Object graph is then accessible outside Smooks via the ExecutionContext.
xslt-basic XSLT A very basic example that illustrates how Smooks can be used to apply an XSLT based transform on a message fragment.
xslt-namespaces XML, XSLT A basic example that illustrates how Smooks can be used to apply an XSLT based transformation on a message fragment that contains namespaces.
custom-java Visitor A very basic example that illustrates How to write a custom message fragment Visitor in Java.
groovy Groovy, Mixing-DOM-&-SAX This example illustrates how Smooks can be used in conjunction with Groovy to perform a Fragment based Transformation.
java-to-java JavaSource, JavaResult This example illustrates how Smooks can be used to transform one Java Object Graph to another Java Object Graph, without constructing any intermediate models.
model-driven-basic XML, FreeMarker Basic "Model Driven Transformation" using the Smooks Javabean and Templating Cartridges. The templating is done using FreeMarker.
model-driven-basic-virtual XML, FreeMarker This example is exactly the same as the "model-driven-basic" example except that it uses a "Virtual Model".
csv-to-xml CSV, XML An example of how to configure Smooks to process a CSV stream.
csv-to-xml-2 CSV, XML Extends the more basic csv-to-xml example by demonstrating how to perform a transformation on the individual records in the CSV set.
csv-to-java CSV, XML, Java Binding An example of how to configure Smooks to process a CSV stream and bind the CSV records to a List of Java Objects.
csv-to-java-programmatic CSV, XML, Java Binding An example of how to programmatically configure Smooks (i.e. no XML) to process a CSV stream and bind the CSV records to a List of Java Objects.
edi-to-xml EDI, XML An example of how to configure Smooks to process a non-XML stream (EDI).
edi-to-java EDI, JavaResult An example of how to configure Smooks to process a non-XML stream (EDI) and bind the data from that stream into Java Business Objects (Javabeans).
ejc EDI, Edifact Java Compiler Generate a Java Object Model plus Smooks binding configuration from a EDI Mapping model.
edi-with-import-to-java EDI, Model Import The edi-to-java, with an model import in the EDI model.
profiling XML A simple example of how Smooks can be used to "profile" a set of messages, and so share transformation/analysis configurations across a message set.
css This example illustrates how to use the Smooks CSS Cartridge to analyze the CSS components of a HTML document.
servlet Servlet This example illustrates how to deploy Smooks in a Servlet Container and use it to perform useragent/browser specific transforms on a Servlet Response
db-extract-transform-load This example illustrates how Smooks can be used to extract data from an EDI message and load this data into a database, all without writing a single line of code (except for the "Main" class that executes Smooks).
split-transform-route-jms Splitting, Transform, Routing, FreeMarker, JMS, Huge Messages This example illustrates how Smooks can be used to split a message (XML in this case) and route the split messages to a JMS Queue.
split-transform-route-file Splitting, Transform, Routing, FreeMarker,OutputStreamResource, Huge Messages This example illustrates how Smooks can be used to split a message (XML in this case) and route the split messages to file.
dao-router Persistence, JPA Persist message data to a Database using existing Hibernate/JPA/iBATIS resources using the Smooks Persistence Cartridge.
validation-basic Fragment Validation Fragment Validation using Regex and MVEL expressions.