<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
		xmlns:si-xml="http://www.springframework.org/schema/integration/xml"
		xmlns:si="http://www.springframework.org/schema/integration"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xmlns:context="http://www.springframework.org/schema/context"
		xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
			https://www.springframework.org/schema/beans/spring-beans.xsd
			http://www.springframework.org/schema/integration
			https://www.springframework.org/schema/integration/spring-integration.xsd
			http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd
			http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd
			http://www.springframework.org/schema/integration/xml
			https://www.springframework.org/schema/integration/xml/spring-integration-xml.xsd">

	<context:property-placeholder properties-ref="props"/>

	<util:properties id="props">
		<prop key="domResult">DOMResult</prop>
		<prop key="stringResult">StringResult</prop>
 	</util:properties>

    <si:channel id="output">
        <si:queue capacity="1"/>
    </si:channel>

    <si:channel id="withResourceIn"/>

    <si-xml:xslt-transformer id="parseOnly"
                             order="2"
                             auto-startup="false"
                             phase="-1"
                             role="foo"
                             send-timeout="123"
                             input-channel="withResourceIn"
                             output-channel="output"
                             xsl-resource="org/springframework/integration/xml/config/test.xsl"/>

    <si-xml:xslt-transformer id="xsltTransformerWithResource"
                             input-channel="withResourceIn"
                             output-channel="output"
                             xsl-resource="org/springframework/integration/xml/config/test.xsl"/>

    <si:channel id="withTemplatesIn"/>

    <si-xml:xslt-transformer id="xsltTransformerWithTemplates"
                             input-channel="withTemplatesIn"
                             output-channel="output"
                             xsl-templates="templates"/>

    <si:channel id="withTemplatesAndResultTransformerIn"/>

    <si-xml:xslt-transformer id="xsltTransformerWithTemplatesAndResultTransformer"
                             input-channel="withTemplatesAndResultTransformerIn"
                             output-channel="output"
                             xsl-templates="templates"
                             result-transformer="resultTransformer"/>

    <si:channel id="withTemplatesAndResultFactoryIn"/>

    <si-xml:xslt-transformer id="xsltTransformerWithTemplatesAndResultFactory"
                             input-channel="withTemplatesAndResultFactoryIn"
                             output-channel="output"
                             xsl-templates="templates"
                             result-factory="stubResultFactory"/>

    <si:channel id="withTemplatesAndStringResultTypeIn"/>

    <si-xml:xslt-transformer id="xsltTransformerWithTemplatesAndStringResultType"
                             input-channel="withTemplatesAndStringResultTypeIn"
                             output-channel="output"
                             xsl-templates="templates"
                             result-type="${stringResult}"/>


    <si-xml:xslt-transformer id="docInStringResultOutTransformer"
                             input-channel="docinStringResultOutTransformerChannel"
                             output-channel="output" result-type="${stringResult}"
                             xsl-resource="classpath:org/springframework/integration/xml/transformer/transformer.xslt">
    </si-xml:xslt-transformer>


    <si-xml:xslt-transformer id="stringResultOutTransformer"
                             input-channel="stringResultOutTransformerChannel"
                             output-channel="output" result-type="${domResult}"
                             xsl-resource="classpath:org/springframework/integration/xml/transformer/transform.xsl">
    </si-xml:xslt-transformer>

    <si-xml:xslt-transformer id="stringInCustomResultFactory"
                             input-channel="stringInCustomResultFactoryChannel"
                             output-channel="output" result-factory="fixedStringResultFactory"
                             xsl-resource="classpath:org/springframework/integration/xml/transformer/transform.xsl">
    </si-xml:xslt-transformer>


    <bean id="fixedStringResultFactory" class="org.springframework.integration.xml.transformer.CustomTestResultFactory">
        <constructor-arg value="fixedStringForTesting"/>
    </bean>

    <bean id="templates" class="org.springframework.integration.xml.config.TestTemplatesFactory"/>

    <bean id="resultTransformer" class="org.springframework.integration.xml.config.StubResultTransformer">
        <constructor-arg value="testReturn"/>
    </bean>

    <bean id="stubResultFactory" class="org.springframework.integration.xml.config.StubResultFactory"/>

</beans>
