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

Re: UPA example

From: Pete Cordell <petexmldev@codalogic.com>
Date: Wed, 25 Jun 2008 14:18:54 +0100
Message-ID: <002701c8d6c6$0637d490$ea00a8c0@Codalogic>
To: "Michael Kay" <mike@saxonica.com>, "'Boris Kolpackov'" <boris@codesynthesis.com>, <xmlschema-dev@w3.org>

- Original Message From: "Pete Cordell"

> 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 ... has similarities to how regular expressions behave.

Apologies for answering my only e-mail, but just to check that I wasn't 
mistaken about the behaviour of regular expressions, I put together the 
following Perl program:


$instance = 'AAA';
$instance =~ /(?:A(.+))+/;

print "instance: $instance\n";
print "captured: $1\n";

This gave the output:
instance: AAA
captured: AA

which seems quite sensible to me and I think XSD1.1 should emulate it.

(In case it is not obvious, my A in the regular expression corresponds to an 
<xs:element ref='apple'/> and the . the xs:any wildcard.  Just in case 
you're out of practice on your PCREs, the (?:...) construct provides 
grouping without any capturing.  One day I won't have to look that up!)


Pete Cordell
For XML C++ data binding visit http://www.codalogic.com/lmx/
Received on Wednesday, 25 June 2008 13:19:40 UTC

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