<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns="http://www.mulesource.org/schema/mule/xml/2.0"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.0"
            xmlns:spring="http://www.springframework.org/schema/beans"
            targetNamespace="http://www.mulesource.org/schema/mule/xml/2.0"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
    <xsd:import namespace="http://www.springframework.org/schema/beans"
                schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"/>
    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.0"
                schemaLocation="http://www.mulesource.org/schema/mule/core/2.0/mule.xsd" />

    <!-- xml filters -->

    <xsd:element name="is-xml-filter" type="mule:abstractFilterType" substitutionGroup="mule:abstract-filter"/>

    <xsd:element name="jxpath-filter" type="jxpathFilterType" substitutionGroup="mule:abstract-filter"/>
    <xsd:complexType name="jxpathFilterType">
        <xsd:complexContent>
            <xsd:extension base="mule:patternFilterType">
                <xsd:sequence>
                    <xsd:element name="namespace" type="namespaceType" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element name="context-property" type="spring:entryType" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="lenient" type="mule:substitutableBoolean" default="true"/>
                <xsd:attribute name="expectedValue" type="xsd:string"/>
           </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <!-- xml outbound routers -->

    <xsd:element name="message-splitter" type="messageSplitterType" substitutionGroup="mule:abstract-outbound-router"/>
    <xsd:complexType name="messageSplitterType">
        <xsd:complexContent>
            <xsd:extension base="mule:messageSplitterOutboundRouterType">
                <!-- these appear after endpoints, which is ugly.  refactor? -->
                <xsd:sequence>
                    <xsd:element name="namespace" type="namespaceType" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="splitExpression" type="xsd:string"/>
                <xsd:attribute name="externalSchemaLocation" type="xsd:string"/>
                <xsd:attribute name="validateSchema" type="mule:substitutableBoolean"/>
           </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="round-robin-splitter" type="roundRobinSplitterType" substitutionGroup="mule:abstract-outbound-router"/>
    <xsd:complexType name="roundRobinSplitterType">
        <xsd:complexContent>
            <xsd:extension base="messageSplitterType">
                <xsd:attribute name="endpointFiltering" type="mule:substitutableBoolean">
                    <xsd:annotation>
                        <xsd:documentation>
                            If true then the message part is sent to the first endpoint whose
                            filter accepts the part.  The default is false.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
                <xsd:attribute name="deterministic" type="mule:substitutableBoolean">
                    <xsd:annotation>
                        <xsd:documentation>
                            If endpointFiltering is false and this option is true (the default)
                            then the first message part if routed to the first endpoint, the
                            second part to the second endpoint, etc, with the nth part going to
                            the (n modulo number of endpoints) endpoint.
                            If false then the messages will be distributed equally amongst all
                            endpoints.
                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:attribute>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <!-- xml transformers -->
    <!-- these just appear at the top level, there's no extended group -->

    <xsd:complexType name="xmlTransformerType">
        <xsd:complexContent>
            <xsd:extension base="mule:abstractTransformerType">
                <xsd:attribute name="outputEncoding" type="xsd:string"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="dom-to-xml-transformer" type="xmlTransformerType" substitutionGroup="mule:abstract-transformer"/>
    <xsd:element name="dom-to-output-handler-transformer" type="xmlTransformerType" substitutionGroup="mule:abstract-transformer"/>

    <xsd:element name="jxpath-extractor-transformer" type="jxpathExtractorType" substitutionGroup="mule:abstract-transformer"/>
    <xsd:complexType name="jxpathExtractorType">
        <xsd:complexContent>
            <xsd:extension base="mule:abstractTransformerType">
                <xsd:attribute name="expression" type="xsd:string"/>
                <xsd:attribute name="singleResult" type="mule:substitutableBoolean"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="object-to-xml-transformer" type="objectToXmlType" substitutionGroup="mule:abstract-transformer"/>
    <xsd:complexType name="objectToXmlType">
        <xsd:complexContent>
            <xsd:extension base="mule:abstractTransformerType">
                <xsd:attribute name="acceptUMOMessage" type="mule:substitutableBoolean"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="xml-to-dom-transformer" type="xmlTransformerType" substitutionGroup="mule:abstract-transformer"/>
    <xsd:element name="xml-to-object-transformer" type="mule:abstractTransformerType" substitutionGroup="mule:abstract-transformer"/>

    <xsd:element name="xslt-transformer" type="xsltTransformerType" substitutionGroup="mule:abstract-transformer"/>
    <xsd:complexType name="xsltTransformerType">
        <xsd:complexContent>
            <xsd:extension base="xmlTransformerType">
                <xsd:sequence>
                    <xsd:element name="xslt-text" maxOccurs="1" minOccurs="0" type="xsltTextType"/>
                    <xsd:element name="context-property" type="spring:entryType" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="maxIdleTransformers" type="mule:substitutableInt"/>
                <xsd:attribute name="maxActiveTransformers" type="mule:substitutableInt"/>
                <xsd:attribute name="xsl-file" type="xsd:string"/>
                <xsd:attribute name="transformerFactoryClass" type="xsd:NMTOKEN"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:complexType name="xsltTextType">
        <xsd:sequence maxOccurs="1" minOccurs="1">
            <xsd:any namespace="http://www.w3.org/1999/XSL/Transform" minOccurs="0" maxOccurs="1" processContents="lax"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="xml-prettyprinter-transformer" type="xmlPrettyPrinterType" substitutionGroup="mule:abstract-transformer"/>
    <xsd:complexType name="xmlPrettyPrinterType">
        <xsd:complexContent>
            <xsd:extension base="mule:abstractTransformerType">
                <xsd:attribute name="encoding" type="xsd:string"/>
                <xsd:attribute name="expandEmptyElements" type="mule:substitutableBoolean"/>
                <xsd:attribute name="indentEnabled" type="mule:substitutableBoolean"/>
                <xsd:attribute name="indentString" type="xsd:string"/>
                <xsd:attribute name="indentSize" type="mule:substitutableInt"/>
                <xsd:attribute name="lineSeparator" type="xsd:string"/>
                <xsd:attribute name="newLineAfterNTags" type="mule:substitutableInt"/>
                <xsd:attribute name="newlines" type="mule:substitutableBoolean"/>
                <xsd:attribute name="omitEncoding" type="mule:substitutableBoolean"/>
                <xsd:attribute name="padText" type="mule:substitutableBoolean"/>
                <xsd:attribute name="suppressDeclaration" type="mule:substitutableBoolean"/>
                <xsd:attribute name="trimText" type="mule:substitutableBoolean"/>
                <xsd:attribute name="XHTML" type="mule:substitutableBoolean"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <!-- xml support -->

    <xsd:complexType name="namespaceType">
        <xsd:attribute name="prefix" type="xsd:string" use="required"/>
        <xsd:attribute name="uri" type="xsd:string" use="required"/>
    </xsd:complexType>

</xsd:schema>
