[relaxng-user] (no subject)

David Tolpin dvd at davidashen.net
Sat Jan 10 01:55:22 ICT 2004


> You have stepped on one of the very few arbitrary restrictions of RNG:
> you can't interleave typed data, only elements and text.
> 
> You could write a bit of XSLT to generate all the cases.
> There are 27 logical cases.
> 
> The 1 zero-feature case can be written in 1 way.
> The 6 one-feature cases can be written in 1 way each.
> The 12 two-features cases can be written in 2 ways each.
> The 8 three-feature cases can be written in 6 ways each.
> 
> Total physical cases: 79.
> 

One should not go so far. Relax NG is not that bad.

hl=("hide"|"show")?
ed=("enable"|"disable")?
lr=("raise"|"lower")?

state=attribute state {list {
    (hl,((ed,lr)|(lr,ed)))
  | (lr,((hl,ed)|(ed,hl)))
  | (ed,((hl,lr)|(lr,hl)))}}

start = element test { state }

Choice is allowed. But in general, regular expressions with interleave would help.


David



More information about the relaxng-user mailing list