Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xsd ambigious

From: "Pete Cordell" <petexmldev@---------.--->
To: "Neill, Andrew" <andy.neill@-------.--->
Date: 10/9/2009 8:35:00 AM
Hi Andy,

That's great.  Actually, I don't know whether you noticed already, but 
looking at it again, I don't think the minOccurs="0" on the xsd:sequence is 
required.

HTH,

Pete.
----- Original Message ----- 
From: "Neill, Andrew" <andy.neill@s...>
To: "Pete Cordell" <petexmldev@c...>; <xmlschema-dev@w...>
Sent: Thursday, October 08, 2009 11:11 AM
Subject: RE: xsd ambigious



Hi Pete,

That works. I don't know how I missed that.

Many Thanks,
Andy

-----Original Message-----
From: Pete Cordell [mailto:petexmldev@c...]
Sent: 08 October 2009 11:07
To: Neill, Andrew; xmlschema-dev@w...
Subject: Re: xsd ambigious

Hi Andy,

Does something like the following work?
    ...
   <xsd:choice maxOccurs="unbounded">
    <xsd:element ref="a" minOccurs="0"/>
    <xsd:element ref="b" minOccurs="0"/>
    <xsd:element ref="c" minOccurs="0"/>
    <xsd:sequence minOccurs="0">
        <xsd:element ref="d"/>
        <xsd:choice>
            <xsd:sequence>
                 <xsd:element ref="e"/>
                 <xsd:element ref="f" minOccurs="0"/>
            </xsd:sequence>
            <xsd:element ref="f"/>
        </xsd:choice>
    </xsd:sequence>
    ...

HTH,

Pete.
--
=============================================
Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using XML C++
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info
=============================================

----- Original Message ----- 
From: "Neill, Andrew" <andy.neill@s...>
To: <xmlschema-dev@w...>
Sent: Wednesday, October 07, 2009 5:10 PM
Subject: xsd ambigious


Can anyone help with this XSD please? It doesnt seem to work?
Essentially i want to ensure that if "E" or "F" are populated then "D" is
populated before them. The rest of the elements can appear in any order and
any amount of times.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="element">
  <xsd:complexType>
   <xsd:choice maxOccurs="unbounded">
    <xsd:element ref="a" minOccurs="0"/>
    <xsd:element ref="b" minOccurs="0"/>
    <xsd:element ref="c" minOccurs="0"/>
    <xsd:sequence>
     <xsd:element ref="d"/>
     <xsd:element ref="e"/>
    </xsd:sequence>
    <xsd:sequence>
     <xsd:element ref="d"/>
     <xsd:element ref="f"/>
    </xsd:sequence>
   </xsd:choice>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="a"/>
 <xsd:element name="b"/>
 <xsd:element name="c"/>
 <xsd:element name="d"/>
 <xsd:element name="e"/>
 <xsd:element name="f"/>
</xsd:schema>

Many Thanks,
Andy









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