Question

I need to create an XSD which would validate the following type of XML:

<dbengine stylesheet="file:transformation.xslt">
   <queries>
      <query name="update" inputtype="file">file:/src/test.sql</query>
      <query name="update" inputtype="sql">select * from test</query>
   </queries>
</dbengine>

This can be done by formulating the following schema:

<xsd:element name="dbengine">
    <xsd:complexType>   
        <xsd:sequence>
            <xsd:element name="queries" type="queries" minOccurs="1"/>
        </xsd:sequence>
        <xsd:attribute name="stylesheet" type="xsd:string" use="optional"/>
    </xsd:complexType>
</xsd:element>

Additionally, I need this tag to be able to receive and send messages from/to a channel by extending inputOutputEndpointType from http://www.springframework.org/schema/integration/spring-integration-1.0.xsd. So ideally I should have something like this:

<xsd:element name="dbengine">
    <xsd:complexType>
        <xsd:complexContent>            
            <xsd:extension base="int:inputOutputEndpointType" >
                <xsd:sequence>
                    <xsd:element name="queries" type="queries" minOccurs="1"/>
                </xsd:sequence>         
            <xsd:attribute name="stylesheet" type="xsd:string" use="optional"/>         
            </xsd:extension>                        
        </xsd:complexContent>       
    </xsd:complexType>
</xsd:element>

However this results in an error (in the eclipse editor):

cos-ct-extends.1.4.3.2.2.1.a: The content type of a derived type and that of its base must both be mixed or both be element-only. Type '#AnonType_dbengine3' is element only, but its base type is not.

Adding the mixed="true" attribute doesn't help and every other attempt of solving this failed so far.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top