Jonathan Lang wrote:
> Missing are a way to define patterns to be referenced within attributes
> (because Relax NG doesn't allow for references within attributes)
-snip-
> If I'm mistaken and refs can indeed exist within attributes, I'd modify
> the valueMarkup by inserting an optional defineClause just before the
> pattern, and I'd insert a choice of NCName into pattern;
-snip-
> define ::= NCName ':='
Silly me. This is another case where the Relax NG compact syntax can
inform us, in terms of the <define> element and its contents:
define ::= identifier assignMethod pattern
identifier ::= (NCName - keyword) | quotedIdentifier
assignMethod ::= '=' | '&=' | '|='
In the subset of the Relax NG syntax under consideration, the set of
keywords has been greatly reduced - namely, to "list" and "text". In the
variant syntax I'm proposing, not even those keywords are needed. As
such, identifier can be simplified to NCName for our purposes.
The assignMethod becomes the remaining issue. Normally, the "default"
combine method used is "interleave" (equivelent to "&=" in the above);
however, neither group nor interleave is appropriate for the contents of
an attribute AFAIK, so I'd recommend that the default assign method be
"choice" or "|=".
OTOH, the symbol "|=" seems a bit foreign. I'd like to simply abbreviate
it to "=", but this might cause some confusion with respect to default
values. How about:
valueMarkup ::= '{' define?
(pattern | 'eg:text')
occurrence?
default? '}'
define ::= NCName '='
default ::= '=' literal
where 'eg:text' maps to <text/>.
=====
Jonathan "Dataweaver" Lang
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
Received on Tue Jul 8 08:16:57 2003
This archive was generated by hypermail 2.1.8 : Fri Dec 03 2004 - 14:29:47 UTC