[relaxng-user] Latest proposal for smart regexes in RELAX NG

David Tolpin dvd at davidashen.net
Wed May 5 09:30:11 ICT 2004


> David Tolpin wrote:
> > What would be the compact syntax for rx:?
>
> [ rx:...
>
> But let's assume you know all that and are really asking whether this 
> will be impossibly clumsy to use with the compact syntax? I don't know, 
> and it's a good question (though perhaps if it were clumsy, that would 
> be more a criticism of compact syntax than rx:). Could John or someone 
> cook an example in both XML and compact syntax so people can get the 
> flavor of it? I'd do it myself but my brain is on haitus.

I am asking because I have a feeling that the string-based (as opposed
to XML) syntax for regular expressions (unix-like, adopted by W3C Schema)
is the compact syntax. It is easy to write and convenient to use, 
and actually needs just one addition: ability to compose a regular
expression from parts. 

RNV provides this function - through dsl datatypelibrary and s-pattern
facet. I had written about it on xml-dev, and http://ftp.davidashen.net/PreTI/RNV/readme.txt
tells about it too (I believe) near the bottom of the page -- search for
s-pattern .

I think that use of XML syntax for string templates (and regular expressions
are string templates) is plain wrong. XML regular expressions are good
or XML data, and the regular expressions is Relax NG itself, and the
data is XML. 
  
 Strings are not trees.  Templates should match instances in structure.
Instances regular expressions are matched against are strings; templates
are pretty good as strings too. Just make them structured, that is,
composable. 

David Tolpin


More information about the relaxng-user mailing list