W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

RE: Is anySimpleType a real type?

From: Mark Feblowitz <mfeblowitz@frictionless.com>
Date: Wed, 13 Mar 2002 09:15:36 -0500
Message-ID: <4DBDB4044ABED31183C000508BA0E97F040AB94D@fcpostal.frictionless.com>
To: "'Dare Obasanjo'" <dareo@microsoft.com>
Cc: "Xmlschema-Dev (E-mail)" <xmlschema-dev@w3.org>
As I understand it, substitution groups don't apply in the case of locally
bound elements.

So the complex type 

<xs:complexType name="OL">
        <xs:sequence>
 	  <xs:element name="Note" type="Note" minOccurs="0"
maxOccurs="unbounded" />
 	  <xs:element name="ShipNote" type="Note" minOccurs="0"
maxOccurs="unbounded" />
        </xs:sequence>
 </xs:complexType>

Wouldn't even be subject to the conversion to an equivalent choice group.

If, on the other hand, the complex type were defined as 

<xs:complexType name="OL">
        <xs:sequence>
 	  <xs:element ref="Note" minOccurs="0"  maxOccurs="unbounded" />
 	  <xs:element ref="ShipNote" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
 </xs:complexType>

then there would indeed be a problem - the first Note occurrence would
expand to the equivalent choice group,

<xs:complexType name="OL">
        <xs:sequence>
	<xs:choice>
 	  <xs:element ref="Note" minOccurs="0"  maxOccurs="unbounded" />
 	  <xs:element ref="ShipNote" minOccurs="0" maxOccurs="unbounded" />
	</xs:choice>
	<xs:element ref="ShipNote" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
 </xs:complexType>

Thus leading to the ambiguity. But the case I'm dealing with should suffer
from no such problem, since the elements are locally bound.

I've CC'ed the Schema Dev list for confirmation of this.

Mark

----------------------------------------------------------------------------
----
 
Mark Feblowitz                                   [t] 617.715.7231
Frictionless Commerce Incorporated     [f] 617.495.0188 
XML Architect                                     [e]
mfeblowitz@frictionless.com
400 Technology Square, 9th Floor 
Cambridge, MA 02139 
www.frictionless.com  
 

 -----Original Message-----
From: 	Dare Obasanjo [mailto:dareo@microsoft.com] 
Sent:	Wednesday, March 13, 2002 1:33 AM
To:	Mark Feblowitz
Subject:	RE: Is anySimpleType a real type?

Slight correction...

-- 
THINGS TO DO IF I BECOME AN EVIL OVERLORD #5
The artifact which is the source of my power will not be kept on the
Mountain
of Despair beyond the River of Fire guarded by the Dragons of Eternity.
It 
will be in my safe-deposit box. The same applies to the object which is
my 
one weakness.


> -----Original Message-----
> From: Dare Obasanjo 
> Sent: Tuesday, March 12, 2002 10:24 PM
> To: 'Mark Feblowitz'
> Subject: RE: Is anySimpleType a real type?
> 
> 
> On investigation, I believe that MSXML is not in error. 
> 
> Your complexType in question is defined as 
> 
> 	<xs:complexType name="OL">
>        <xs:sequence>
> 	  <xs:element name="Note" type="Note" minOccurs="0" 
> maxOccurs="unbounded" />
> 	  <xs:element name="ShipNote" type="Note" minOccurs="0" 
> maxOccurs="unbounded" />
> 	 </xs:sequence>
> 	</xs:complexType>
> 
> which after the substitionGroups are applied becomes 
> 
> 	<xs:complexType name="OL">
>        <xs:sequence>

>         <xs:choice>
> 	   <xs:element name="Note" type="Note" minOccurs="0" 
> maxOccurs="unbounded" />
> 	   <xs:element name="ShipNote" type="ShipNote" 
> minOccurs="0" maxOccurs="unbounded" />
> 	  </xs:choice>

The above should be 

	 <xs:choice minOccurs="0"  maxOccurs="unbounded">
 	   <xs:element name="Note" type="Note"  />
 	   <xs:element name="ShipNote" type="ShipNote" />
       </xs:choice>	

> 	  <xs:element name="ShipNote" type="Note" minOccurs="0" 
> maxOccurs="unbounded" />
> 	 </xs:sequence>
> 	</xs:complexType>	
> 
> Which to me is ambiguous once the user because upon seeing a 
> <ShipNote> the parser cannot tell if it is the <ShipNote> 
> that is part of the <xs:choice> content model or the 
> <ShipNote> that comes immediately after the <xs:choice>. 
> 
> 
> -- 
> THINGS TO DO IF I BECOME AN EVIL OVERLORD #5
> The artifact which is the source of my power will not be kept 
> on the Mountain of Despair beyond the River of Fire guarded 
> by the Dragons of Eternity. It 
> will be in my safe-deposit box. The same applies to the 
> object which is my 
> one weakness.
> 
> 
> > -----Original Message-----
> > From: Mark Feblowitz [mailto:mfeblowitz@frictionless.com]
> > Sent: Tuesday, March 12, 2002 5:20 PM
> > To: Dare Obasanjo
> > Subject: RE: Is anySimpleType a real type?
> > 
> > 
> > Dare -
> > 
> > I've attached an xsd and an xml file demonstrating the
> > nondeterminism problem. 
> > 
> >  <<MSXMLBug.xsd>>  <<MSXMLBug.xml>>
> > Validating the file MSXMLBug.xml as-is results in a message 
> > about the schema being nondeterministic.
> > 
> > When I remove the substitutionGroup="Note" from the ShipNote
> > element, the validates completes without errors.
> > 
> > My best guess here is that the validator is treating the
> > local elements Note and ShipNote as global elements. With 
> > this being the case, the Note substitution group head could 
> > contain either a Note or a ShipNote element, leading to the 
> > nondeterminism.
> > 
> > My understanding of the Schema Rec is that local elements
> > cannot participate in substitution groups.
> > 
> > Is this a known MSXML bug?
> > 
> > Thanks for your help,
> > 
> > Mark
> > 
> > --------------------------------------------------------------
> > --------------
> > ----
> >  
> > Mark Feblowitz                                   [t] 617.715.7231
> > Frictionless Commerce Incorporated     [f] 617.495.0188 
> > XML Architect                                     [e]
> > mfeblowitz@frictionless.com
> > 400 Technology Square, 9th Floor
> > Cambridge, MA 02139 
> > www.frictionless.com  
> >  
> > 
> >  -----Original Message-----
> > From: 	Dare Obasanjo [mailto:dareo@microsoft.com] 
> > Sent:	Tuesday, March 12, 2002 3:12 PM
> > To:	Mark Feblowitz; ht@cogsci.ed.ac.uk; Simon.Cox@csiro.au
> > Cc:	xmlschema-dev@w3.org
> > Subject:	RE: Is anySimpleType a real type?
> > 
> > If you have issues with MSXML, you can send me an email
> > detailing the problem along with a repro. 
> > 
> > Thanks.
> > 
> > --
> > THINGS TO DO IF I BECOME AN EVIL OVERLORD #5
> > The artifact which is the source of my power will not be kept 
> > on the Mountain of Despair beyond the River of Fire guarded 
> > by the Dragons of Eternity. It 
> > will be in my safe-deposit box. The same applies to the 
> > object which is my 
> > one weakness.
> > 
> > 
> > > -----Original Message-----
> > > From: Mark Feblowitz [mailto:mfeblowitz@frictionless.com]
> > > Sent: Tuesday, March 12, 2002 6:38 AM
> > > To: 'ht@cogsci.ed.ac.uk'; Simon.Cox@csiro.au
> > > Cc: xmlschema-dev@w3.org
> > > Subject: RE: Is anySimpleType a real type?
> > > 
> > > 
> > > Yes - and it seems to work just fine in all parsers except MSXML, 
> > > which doesn't recognize xs:anySimpleType as a defined type.
> > > 
> > > I'm not sure where/how to report it as a bug. It has 
> forced us into 
> > > some much-less-than-elegant representations.
> > > 
> > > Mark
> > > 
> > > --------------------------------------------------------------
> > > --------------
> > > ----
> > >  
> > > Mark Feblowitz                                   [t] 617.715.7231
> > > Frictionless Commerce Incorporated     [f] 617.495.0188 
> > > XML Architect                                     [e]
> > > mfeblowitz@frictionless.com
> > > 400 Technology Square, 9th Floor
> > > Cambridge, MA 02139
> > > www.frictionless.com  
> > >  
> > > 
> > >  -----Original Message-----
> > > From: 	ht@cogsci.ed.ac.uk [mailto:ht@cogsci.ed.ac.uk] 
> > > Sent:	Tuesday, March 12, 2002 4:29 AM
> > > To:	Simon.Cox@csiro.au
> > > Cc:	xmlschema-dev@w3.org
> > > Subject:	Re: Is anySimpleType a real type?
> > > 
> > > Simon.Cox@csiro.au writes:
> > > 
> > > > Can anySimpleType be used in element declarations?
> > > > Or is it just a notional type whose name cannot be exposed in a 
> > > > schema!
> > > > 
> > > > e.g. I have the following line in a schema document:
> > > > 
> > > > <xs:element name="_ScalarValue" type="xs:anySimpleType" 
> > > > abstract="true" substitutionGroup="gml:_Value"/>
> > > 
> > > Perfectly OK.  Clarification forthcoming on this and 
> related issues 
> > > from the WG, see the Issues list [1], issue R-54.
> > > 
> > > ht
> > > 
> > > [1] http://www.w3.org/2001/05/xmlschema-rec-comments#pfiur-type
> > > -- 
> > >   Henry S. Thompson, HCRC Language Technology Group, 
> University of 
> > > Edinburgh
> > >           W3C Fellow 1999--2002, part-time member of W3C Team
> > >      2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44)
> > > 131 650-4440
> > > 	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
> > > 		     URL: http://www.ltg.ed.ac.uk/~ht/
> > >  [mail really from me _always_ has this .sig -- mail without 
> > > it is forged spam]
> > > 
> > > 
> > 
> 
Received on Wednesday, 13 March 2002 11:01:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:30 GMT