OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Allow difference of patterns


Currently TREX allows the "difference" element to be applied to
name-classes but not to patterns.  Should we allow "difference" to be
applied to patterns as well?

First, a little digression. In general, I have made it a design
principle in TREX to maximize "composability".  It's a little bit hard
to describe.  The idea is that a language provides a number of different
kinds of atomic thing, and a number different ways to compose new things
out of other things.  Maximizing composability means minimizing
restrictions on which ways to compose things can be applied to which
kinds of thing. Maximizing composability tends to improve the ratio
between functionality on the one hand and simplicity/ease of use/ease of
learning on the other.

Composability would suggest that "difference" should be applicable to
patterns as well as name-classes.  There are also some practical use
cases.  For example, in the pattern for XSLT, I need to be able to say:

- if the version attribute on xsl:stylesheet equals 1.0, then the
attributes and content must match this pattern

- if the version attribute on xsl:stylesheet equals 1.1, then the
attributes and content must match this other pattern

- if the version attribute on xsl:stylesheet is neither 1.1 nor 1.0,
then the attribute and content should match another pattern
corresponding to XSLT's forwards compatibility rules

Another use case is where an attribute is being used to subclass an
element name (like the class attribute in HTML).  In general in XML,
it's a matter of taste whether you use <para.warning> or <para
class="warning">.  If you have such an attribute, then you need
difference on attribute values as much as you need it on element names.

James



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC