Hi Martin,

"Thomson, Martin" <martin.thom...@andrew.com> wrote on 09/22/2010 09:22:56
PM:

> I'm trying to understand why Xerces is rejecting what appears to be
> a simple restriction.
>
> The base type permits either of A,B or A,C,D; the restricting types
> simply remove the choice:
>
> Base = (A,(B|(C,D)))
> i.   Restriction = (A,B)        -- OK
> ii.  Restriction = (A,C,D)      -- Not OK
> iii. Restriction = (A,(C,D))    -- Not OK
> iv.  Restriction = (A,((C,D)|)) -- Not OK
>
> As the last two examples show, mimicking the structure of the base
> type with choices and sequences is too easily collapsed this to bluff it.
>
> I get the impression that this is related to MapAndSum [1].  From my
> uneducated reading, it seems like MapAndSum never considered the
> simple case where the sequence mapped entirely to one of the
> particles of the choice.
>
> XSV [2] accepts all four forms.
>
> I can see how this might be viewed as a valid interpretation of the
> specification, but it's a real nuisance.  Should I raise a bug report on
this?

If Xerces is doing what the XML Schema 1.0 specification says then by
definition it's working as designed and therefore not a bug. XSV [3] may
not be following all the rules.

XML Schema 1.1 is defining more sensible restriction rules so what you're
trying to do should probably work with Xerces' XML Schema 1.1 processor
once we implement that part of the 1.1 spec.

> Cheers,
> Martin
>
> [1] http://www.w3.org/TR/xmlschema-1/#rcase-MapAndSum
> [2] http://www.w3.org/2001/03/webdata/xsv

Thanks.

[3] http://lists.w3.org/Archives/Public/xmlschema-dev/2001Nov/0132.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Reply via email to