Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Schema issue

From: "Rahul" <reach_aggarwal@-------.--->
To: NULL
Date: 3/20/2009 12:46:00 PM
Hi,

I have to define a schema as below but this is not valid according to schema 
rules.

It violates the followign rule because I have element B as minOccurs = 0. It 
is fine if I make B as MinOccurs = 1.

http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/#cos-nonambig

How can I have define the schema in this situation so as to not violate the 
above rule.

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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns="http://test.xsd" targetNamespace="http://test.xsd" 
elementFormDefault="qualified" attributeFormDefault="unqualified">

<xsd:element name="X" type="X"/>

<xsd:complexType name="X">

<xsd:sequence>

<xsd:element name="A" type="xsd:string" minOccurs="0" 
maxOccurs="unbounded"/>

<xsd:element name="B" type="xsd:string" minOccurs="0" maxOccurs="1"/>

<xsd:element name="A" type="xsd:string" minOccurs="0" 
maxOccurs="unbounded"/>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>



Thanks

Rahul




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