Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Restricting child elements in a schema

From: dilpa.mehta@-------.---
To: xmlschema-dev@--.---
Date: 12/2/2004 5:30:00 AM
Let me describe my problem little more in detail.
We are using acord schema as our base. We have no control over changing 
the acord schema.
We defined our own schema and we imported acord schema so that we could 
resuse acord elements.
We used <xs:restrction> for some complex types and used <xs:extension> for 
others. 
We used <xs:extension> for complex types coz we have following 
requirements
        1) Use some elements within the complex type as it is
        2) Redefine some elements to make them required as they were not 
required in acord schema 
        3) Add more elements to the extended complex type
The problem we are facing is while doing step # 3.
Here is an snippet,

Parent Acord schema 
<xs:complexType name="ContractType">
                <xs:sequence>
                        <xs:element ref="ContractName" minOccurs="0"/>
                        <xs:element ref="ContractType" minOccurs="0"/>
                        <xs:element ref="BrokerReference" minOccurs="0"/> 
(Optional)
                </xs:sequence>
</xs:complexType>

Our schema

<xs:import namespace="
http://www.ACORD.org/standards/Jv-Ins-Reinsurance/2004-1" schemaLocation="
Jv-Ins-Reinsurance-2004-1.xsd"/>
<xs:complexType name="GCContractType">
                <xs:complexContent>
                        <xs:extension base="acord:ContractType">
                                <xs:sequence>
                                        <xs:element ref="
acord:BrokerReference" substitutionGroup="acord:BrokerReference"/> (Change 
the element  defined in parent as required and use all the other elements 
as it is and add a new element 'GCContractVersion')
                                        <xs:element ref="GCContractVersion
"/>
                                </xs:sequence>
                        </xs:extension>
                </xs:complexContent>
</xs:complexType>

Above, worked with xmlspy 2004 but with xmlspy 2005 we get an error saying 
substitutionGroup cannot be uused with xs:element as it is local.I read 
the docs and i beleive that substitutionGroup can be used only directly 
under <xs:schema>.
Is there an alernate way of handling this so that  all 3 requirements are 
met?


Thanks
Dilpa


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent