Not able to transform java object to desired xml
ashok_1979 Dec 15, 2008 2:21 AMHi All,
i want to transform java object into xml file.
to achieve this what i am doing is
1. First i am creating SAX stream from java object using below configuration
<resource-config selector="global-parameters">
SAX
</resource-config>
This is creating one XML stream out of the object in below format
<com.service.railbill.valueObject.ShipmentDetailsVO>
421
true
0
true
...
...
<com.service.railbill.valueObject.ShipmentDetailsVO>
2. Now i want to transform this default XML into desired XML format by using this configuration
<resource-config selector="com.service.railbill.valueObject.ShipmentDetailsVO">
<![CDATA[
<xsl:for-each select="shipmentData">
</xsl:for-each>
<xsl:for-each select="lineItems">
<xsl:for-each select="com.service.railbill.valueObject.ShipmentLineVO">
</xsl:for-each>
</xsl:for-each>
]]>
true
</resource-config>
But second transformation is not getting applied, i am getting following lines in logger
12:41:02,218 INFO [STDOUT] Value of action: TransformShipmentData
12:41:02,218 INFO [STDOUT] Old Value of resource config: E://smooks-config.xml
12:41:02,218 INFO [STDOUT] New Value of resource config: E://smooks-config.xml
12:41:02,218 INFO [STDOUT] Exit from updateConfigTree(ConfigTree configTree, St
ring resourceConfPath) of TransformDataAction class:
12:41:02,218 INFO [STDOUT] Value of resource config in process method: E://smoo
ks-config.xml
12:41:02,218 INFO [ClassUtil] Loaded 4 classes from 2 URLs through class list f
ile META-INF/content-handlers.inf. Process took 0ms. Turn on debug logging for
more info.
12:41:02,359 INFO [ContentDeliveryConfigBuilder] All configured XML Element Con
tent Handler resource configurations can be applied using the SAX or DOM Stream
Filter. Defaulting to DOM Filter. Set 'global-parameters:stream.filter.type'.
Turn on debug logging for more info.
Please help me to reach the bottom line of problem.
Below is the complete smooks transformation file i am using
<?xml version="1.0"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd" default-target-profile="from:source-java">
<resource-config selector="global-parameters">
SAX
</resource-config>
<resource-config selector="com.service.railbill.valueObject.ShipmentDetailsVO">
<![CDATA[
<xsl:for-each select="shipmentData">
</xsl:for-each>
<xsl:for-each select="lineItems">
<xsl:for-each select="com.service.railbill.valueObject.ShipmentLineVO">
</xsl:for-each>
</xsl:for-each>
]]>
true
</resource-config>
</smooks-resource-list>