Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: optional, but at least one required

From: "Pete Cordell" <petexmldev@--------------.--->
To: "Virginia Wiswell" <vwiswell@-------.--->
Date: 10/11/2007 10:32:00 AM
To be pedantic, removing the second <xsd:element ref="a"/> prevents the 
Unique Particle Attribution violation for _a_.  We then need to work around 
this change by adding minOccurs="0" to element b so we allow what we want.

:-),

Pete.
----- Original Message ----- 
From: "Virginia Wiswell" <vwiswell@v...>
To: "Pete Cordell" <petexmldev@t...>; "Virginia Wiswell" 
<vwiswell@v...>
Cc: <xmlschema-dev@w...>
Sent: Thursday, October 11, 2007 2:35 AM
Subject: Re: optional, but at least one required


>
> So the minOccurs="0" on element b prevents the Unique Particle Attribution 
> violation for b?
>
> This is perfect, Pete. Thanks so much for helping me out.
>
> On Wed, 10 Oct 2007 19:22:51 +0100
>  "Pete Cordell" <petexmldev@t...> wrote:
>>
>> Hi Virginia,
>>
>> Your schema should indeed yield a Unique Particle Attribution violation. 
>> The reason is that when a parser reads element a, it is not immediately 
>> obvious whether it corresponds to the first definition of a or the 
>> second.
>>
>> You can get around this by changing your schema to:
>>
>>  <xsd:element name="parent">
>>   <xsd:complexType>
>>    <xsd:choice>
>>      <xsd:sequence>
>>        <xsd:element ref="a"/>
>>        <xsd:element ref="b" minOccurs="0"/>
>>      </xsd:sequence>
>>      <xsd:element ref="b"/>
>>    </xsd:choice>
>>   </xsd:complexType>
>>  </xsd:element>
>>
--
=============================================
Pete Cordell
Codalogic
for XML Schema to C++ data binding visit
 http://www.codalogic.com/lmx/
=============================================



From kstaniraji@y... Thu Oct 11 08:57:12 2007
Received: from aji.w3.org ([133.27.228.225])
	


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