W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2008

RE: [Bug 5906] Problem in definition of <restriction> in <complexType>::<simpleContent>

From: Michael Kay <mike@saxonica.com>
Date: Wed, 15 Oct 2008 15:21:40 +0100
To: "'Mukul Gandhi'" <gandhi.mukul@gmail.com>, <www-xml-schema-comments@w3.org>
Message-ID: <CE23804215B040BDA89B6EE477FA7BEB@Sealion>

The problem can be seen in the content model for simpleContent/restriction
in 3.4.2.2, which reads

Content: (annotation?, (simpleType?, (minExclusive | minInclusive |
maxExclusive | maxInclusive | totalDigits | fractionDigits | maxScale |
minScale | length | minLength | maxLength | enumeration | whiteSpace |
pattern | assert | {any with namespace: ##other})*)?, ((attribute |
attributeGroup)*, anyAttribute?), assert*)

Note that "assert" appears twice. In the first case it appears in its role
as a facet, to restrict the simple content type; this assertion works solely
on the atomic value, for example you could restrict a number to be a
multiple of 5 using <xs:assert test="$value mod 5 = 0"/>. In the second case
it appears as an assertion on the element as a whole, including its
attributes, for example you could assert that if @currency="JPY", then the
value must be an integer: <xs:assert test="if (@currency='JPY') then $value
mod 1 = 0"/>.

But syntactically, there is no way of telling which assertion is which. So
the simple solution (not a very elegant one, I have to say) is to rename one
of them.

I think this is actually a consequence of some poor syntax design in 1.0; I
have always found the syntax of complex-types-with-simple-content very
unnatural. But we have to live with it.

Thanks for your interest in the development of the spec!

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: www-xml-schema-comments-request@w3.org 
> [mailto:www-xml-schema-comments-request@w3.org] On Behalf Of 
> Mukul Gandhi
> Sent: 15 October 2008 14:58
> To: www-xml-schema-comments@w3.org
> Subject: Re: [Bug 5906] Problem in definition of 
> <restriction> in <complexType>::<simpleContent>
> 
> 
> Hello WG members,
>   I need to know the details of the fix in this reply.
> 
> I looked at the member only link (cited below), and all other 
> material about this issue, but unfortunately I have not got 
> enough clarity about this fix.
> 
> Could you please let me know in more simpler terms,
> 
> What was the original problem, and how does this fix address 
> that issue?
> What are the XSD 1.1 grammar details after this fix?
> I would also appreciate any sample XSD 1.1 Schema fragments 
> about assertions, affected by this issue.
> 
> On Fri, Oct 10, 2008 at 10:35 PM,  <bugzilla@wiggum.w3.org> wrote:
> >
> > http://www.w3.org/Bugs/Public/show_bug.cgi?id=5906
> >
> >
> > Sandy Gao <sandygao@ca.ibm.com> changed:
> >
> >           What    |Removed                     |Added
> > 
> --------------------------------------------------------------
> --------------
> >             Status|ASSIGNED                    |RESOLVED
> >           Keywords|needsAgreement,             |resolved
> >                   |needsDrafting               |
> >         Resolution|                            |FIXED
> >
> >
> >
> >
> > --- Comment #2 from Sandy Gao <sandygao@ca.ibm.com>  2008-10-10 
> > 17:05:38 --- On 2008-10-10, the working group adopted a proposal to 
> > address this issue by changing the facet element name from 
> "assert" to 
> > "assertion". (This is mostly a datatypes change.)
> >
> > The proposal adopted can be found here (member-only):
> > http://www.w3.org/XML/Group/2004/06/xmlschema-2/datatypes.b5906.html
> >
> > There were a couple amendments to the above proposal:
> > - An additional <assert> is replaced with <assertion>
> > - Added "assert" to the Schema and DTD for schemas where it was 
> > missing
> >
> >
> > --
> > Configure bugmail: 
> > http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
> > ------- You are receiving this mail because: ------- You are the QA 
> > contact for the bug.
> >
> >
> 
> 
> --
> Regards,
> Mukul Gandhi
> 
Received on Wednesday, 15 October 2008 14:22:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:16 GMT