[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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>
RE: UPA example

> 
> 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
chosen.
> 
> 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
http://www.saxonica.com/
Received on Wednesday, 25 June 2008 23:31:30 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.