RE: xsd ambigious

Hi Pete,

Good point. That sounds like a good idea.

Cheers for that,
Andy 

-----Original Message-----
From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On Behalf Of Pete Cordell
Sent: 09 October 2009 10:03
To: Neill, Andrew
Cc: xmlschema-dev@w3.org
Subject: Re: xsd ambigious

Hi Andy,

In that case it might be more aesthetic to move the minOccurs to the outer 
xsd:choice so you get:

<xsd:choice minOccurs="0" maxOccurs="unbounded">

Pete.
----- Original Message ----- 
From: "Neill, Andrew" <andy.neill@siemens.com>
To: "Pete Cordell" <petexmldev@codalogic.com>
Cc: <xmlschema-dev@w3.org>
Sent: Friday, October 09, 2009 9:35 AM
Subject: RE: xsd ambigious



Hi Pete,

Thanks for that but I thought about it and although I wanted d to appear 
before e or f, it is possible to submit an xml file with none of these 
fields populated so I left it in there.

Cheers,
Andy

-----Original Message-----
From: Pete Cordell [mailto:petexmldev@codalogic.com]
Sent: 09 October 2009 09:33
To: Neill, Andrew
Cc: xmlschema-dev@w3.org
Subject: Re: xsd ambigious

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@siemens.com>
To: "Pete Cordell" <petexmldev@codalogic.com>; <xmlschema-dev@w3.org>
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@codalogic.com]
Sent: 08 October 2009 11:07
To: Neill, Andrew; xmlschema-dev@w3.org
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@siemens.com>
To: <xmlschema-dev@w3.org>
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

Received on Friday, 9 October 2009 09:07:13 UTC