Re: [milyn-dev] The configured Filter ('SAX') cannot be used with the specified set of Smooks visitors

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

Re: [milyn-dev] The configured Filter ('SAX') cannot be used with the specified set of Smooks visitors

Tom Fennelly
Looks like you're using a DOM only visitor in the XSL visitor. That will force Smooks to use DOM filtering no matter what you set the file to. There is something in the docs about that.

On 26 February 2015 at 22:11, Smooks User <[hidden email]> wrote:
Hi,

I am getting the following error while performing EDI to XML for a huge
file.

"org.milyn.SmooksException: The configured Filter ('SAX') cannot be used
with the specified set of Smooks visitors.  The 'DOM' Filter is the only
filter that can be used for this set of Visitors.  Turn on Debug logging for
more information."

*Here is my smooks configuration:*

<?xml version="1.0"?>
<smooks-resource-list
        xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
        xmlns:xsl="http://www.milyn.org/xsd/smooks/xsl-1.1.xsd"
        xmlns:core="http://www.milyn.org/xsd/smooks/smooks-core-1.4.xsd"
        xmlns:edi="http://www.milyn.org/xsd/smooks/edi-1.4.xsd">

        <core:filterSettings type="SAX" defaultSerialization="false" />

    <edi:reader mappingModel="/example/edi-to-xml-mapping.xml"/>

    <resource-config selector="Element1, Element2, Element3">
        <resource>org.milyn.delivery.DomModelCreator</resource>
        </resource-config>

        <xsl:xsl applyOnElement="Element1, Element2, Element3">
        <xsl:template>/example/BasicXslTransform.xsl</xsl:template>
    </xsl:xsl>
</smooks-resource-list>


*Here is my Java code:*

        protected static void runSmooksTransform() throws IOException,
SAXException, SmooksException {
        Smooks smooks = new Smooks("smooks-config.xml");
        try {
            ExecutionContext executionContext =
smooks.createExecutionContext();
            smooks.filterSource(executionContext, new StreamSource(new
FileInputStream("input.edi")));
        } catch (Exception e) {
                e.printStackTrace();
        }
        finally {
            smooks.close();
        }
    }

May I know what I am doing wrong here?

Thanks,



--
View this message in context: http://milyn.996300.n3.nabble.com/The-configured-Filter-SAX-cannot-be-used-with-the-specified-set-of-Smooks-visitors-tp8994.html
Sent from the milyn - dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email