Refer to the SmooksResourceConfiguration, AbstractBeanPopulator and XslContentDeliveryUnitCreator docs when reading these configurations.
For the request (trans-request.cdrl):
<?xml version="1.0"?>
<!DOCTYPE smooks-resource-list PUBLIC "-//MILYN//DTD SMOOKS 1.0//EN" "http://www.milyn.org/dtd/smooksres-list-1.0.dtd">
<smooks-resource-list default-useragent="shipping-request">
<!--
Configure the TrackingNumber bean creation and population...
-->
<smooks-resource selector="trackingNumber" path="org.milyn.javabean.ProcessingPhaseBeanPopulator">
<!-- create and bind the bean instance -->
<param name="beanId">trackingNumber</param>
<param name="beanClass">org.milyn.templating.soapshipping.TrackingNumber</param>
</smooks-resource>
<smooks-resource selector="trackingNumber shipperID" path="org.milyn.javabean.ProcessingPhaseBeanPopulator">
<!-- extract shipperID text and set on the trackingNumber bean -->
<param name="beanId">trackingNumber</param>
<param name="setterName">setShipperID</param>
</smooks-resource>
<smooks-resource selector="trackingNumber shipmentNumber" path="org.milyn.javabean.ProcessingPhaseBeanPopulator">
<!-- extract shipmentNumber text and set on the trackingNumber bean -->
<param name="beanId">trackingNumber</param>
<param name="setterName">setShipmentNumber</param>
</smooks-resource>
<!--
Use an XSLT templatelet to perform the transformation.
We're transforming the "trackingNumber" element...
-->
<smooks-resource selector="trackingNumber">
<param name="restype">xsl</param>
<param name="resdata">
<!--
<trackingNumber>
<xsl:value-of select="smooks-bean:select('trackingNumber')" />
</trackingNumber>
-->
</param>
</smooks-resource>
</smooks-resource-list>
For the response (trans-response.cdrl):
<?xml version="1.0"?> <!DOCTYPE smooks-resource-list PUBLIC "-//MILYN//DTD SMOOKS 1.0//EN" "http://www.milyn.org/dtd/smooksres-list-1.0.dtd"> <smooks-resource-list default-useragent="shipping-response"> <!-- Configure the History bean creation and population... --> <smooks-resource selector="history" path="org.milyn.javabean.ProcessingPhaseBeanPopulator"> <!-- create and bind the bean instance --> <param name="beanId">history</param> <param name="beanClass">org.milyn.templating.soapshipping.History</param> <!-- extract the tracking numbers text and set on the bean --> <param name="setterName">setTrackingNumbers</param> </smooks-resource> <!-- Use a full XSLT template to perform the transformation. We're transforming the "history" element... --> <smooks-resource selector="history" path="/org/milyn/templating/soapshipping/xslt/HistoryTrans.xsl"> <param name="is-xslt-templatelet">false</param> </smooks-resource> </smooks-resource-list>
Labels