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

Re: the UPA-constraint and danish word division

From: Xan Gregg <xan.gregg@jmp.com>
Date: Mon, 18 Sep 2006 16:56:14 -0400
Message-Id: <7B4ACF26-9492-4BD0-B722-F825E88DE201@jmp.com>
Cc: Marie Bilde Rasmussen <mariebilderas@gmail.com>, xmlschema-dev@w3.org
To: C. M. Sperberg-McQueen <cmsmcq@acm.org>
Re: the UPA-constraint and danish word division

I don't quite have a UPA friendly version of this grammar, but the  
optionality of hyphens and blanks between wordparts makes it a little  
different from the chess example. Imagine if black moves were  
optional in chess; then the model could be (W, B?)*, which obeys UPA.

In this case, though, there is a twist in that the final wordpart can  
be followed by a hyphen but not a blank, which is different from the  
other wordpart gaps. If ignore this difference, we get a little  
stricter model in the spirit of Michael's approach #2 (come as close  
as possible and rely on a subsequent processor to catch the missed  
cases. Here's a model that allows a trailing blank and/or hyphen:

     ((h, (w, (((h, b?) | (b, h?))?, w)+ ))
     |    (w,  ((h, b?) | (b, h?))){2, unbounded}
     )

where "{2, unbounded}" is the quantifier "minOccurs = 2, maxOccurs =  
unbounded".

xan

On Sep 15, 2006, at 11:34 PM, C. M. Sperberg-McQueen wrote:

>
> I can see three approaches to your problem in practice:
>
>
> (2) define an XSD rule that comes as close as you can to
> restricting the data without violating UPA, and use
> Schematron to supply the additional check.  Your rule
> might be:
>
>     ((h, (w, (((h, b?) | (b, h?))?, w)+ ))
>     |    (w,  ((h, b?) | (b, h?))?, w, (h | b | w)*)
>     )
>
> and Schematron rules can check that
>
>   each b is followed on the right either by a wordpart
>     or by a hyphen and then a wordpart
>   each hyphen is followed on the right by
>     (a) a wordpart, or (b) a blank and then a
>     wordpart, or (c) nothing
Received on Monday, 18 September 2006 20:56:25 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.