How xml schema include element is used in Sonic?

Posted by jerem on 23-Apr-2010 05:06

Hello

I have two xsd files.

The first one describe a generic message with technical datas.

the second one include the first and describe business datas.

when I include the second schema in the workbench I was not be able to find my root element specified in the first schema.

This way of building schemas allow us to describe a complete message (like inheritance).

If I add the include element in the Flu.xsd schemas it won't be easy and safe to manage multiple BusDataPartenaireN.xsd schemas.

Do you have an idea?

Best regards

Chan Jeremy

example :

first schema Flu.xsd

<?xml version="1.0" encoding="utf-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

elementFormDefault="unqualified" attributeFormDefault="unqualified"

version="001">

  <xs:element name="Flu">

    <xs:complexType>

      <xs:all>

        <xs:element name="TecDat" type="xs:string"></xs:element>

        <xs:element name="BusDat" type="BusDat" minOccurs="0">

        </xs:element>

      </xs:all>

    </xs:complexType>

  </xs:element>

</xs:schema>

the second one BusDatPartenaire1.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified" version="001">
    <xs:include schemaLocation="Flu.xsd"/>
    <xs:complexType name="BusDat">
        <xs:all>
            <xs:element name="BusDat1" type="xs:string" />
            <xs:element name="BusDat2" type="xs:string" />
            <xs:element name="BusDat3" type="xs:string" />   
        </xs:all>
    </xs:complexType>
</xs:schema>

All Replies

Posted by tsteinbo on 10-May-2010 06:23

what about an xs:include statement in the top level schema?

This thread is closed