Changed XML (post xslt) JavaBinding not working

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Changed XML (post xslt) JavaBinding not working

Hi All,

I am trying to do a simple javabinding on an xml which first gets changed (an element is added ) using xslt. In JavaResult post filter, the element which got added does not reflect, which means in the final HashMap element2 does not come though element1 comes.

Following are the source-xml,xslt, smooks-config and code fragment I have used. Please suggest if I should be doing something differently.

            <element id="1">10</element>

<xsl:stylesheet xmlns:xsl=""
<xsl:template match="@*|node()">
    <xsl:apply-templates select="@*|node()"/>
<xsl:template match="list">
     <xsl:apply-templates select="@* | *"/>
     <element1 id="2">20</element1> 

<?xml version="1.0"?>
<smooks-resource-list xmlns=""

    <xsl:xsl applyOnElement="#document">

        <jb:bean beanId="VoltErrorMap" class="java.util.HashMap" createOnElement="list" retain="true">
         <jb:value property="element" data="element"/>
         <jb:value property="element1" data="element1"/>


        // Instantiate Smooks with the config...
        Smooks smooks = new Smooks("smooks-config.xml");

        try {
             // Create an exec context - no profiles....
            ExecutionContext executionContext = smooks.createExecutionContext();
                        JavaResult result = new JavaResult();

            // Configure the execution context to generate a report...
            executionContext.setEventListener(new HtmlReportGenerator("target/report/report.html"));

                        smooks.filterSource(executionContext, new StreamSource(new ByteArrayInputStream(messageIn)), result);