W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2008

RE: UPA example

From: Michael Kay <mike@saxonica.com>
Date: Thu, 26 Jun 2008 00:30:44 +0100
To: "'Pete Cordell'" <petexmldev@codalogic.com>, "'Boris Kolpackov'" <boris@codesynthesis.com>, <xmlschema-dev@w3.org>
Message-ID: <FEB0BBF67F504627A35DC150D37EE0DA@Sealion>

> So I take it that under the XSD 1.1 rules, the instance would 
> be valid and have particle assigment corresponding to:
>  <apple/> validated by element
>  <apple/> validated by any
>  <apple/> validated by any
> Rather than:
>  <apple/> validated by element
>  <apple/> validated by any
>  <apple/> validated by element

No, I think it will take the first parse, because when the next element can
match either an element particle or a wildcard, the element particle will be
> Personally I think that, subject to occurrence constraints, 
> the particle that is currently gobbling up input, should have 
> priority (i.e. they're greedy).  That seems a lot easier to 
> implement, it's a lot easier for schema authors/users to 
> understand and has similarities to how regular expressions 
> behave. 

Then I suggest you make the suggestion as a comment on the last call spec
which has just been published.

I can't say I feel strongly about it. Which way is easier for implementors
will depend, as always, on the internal design of the implementation (and in
particular on how counters are implemented). I can see it being tricky to
formalize the notion of "the particle that is currently gobbling up input" -
or perhaps not, it might simply be a case of saying that in the event of an
element matching more than one particle, the preferred one is the particle
to which the previous element was attributed.

Michael Kay
Received on Wednesday, 25 June 2008 23:31:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:47 UTC