Subject: [Lager] Schema use of "text" incorrect or too permissive

From: Asmus Freytag <[email-masked]>
Date: Sun, 6 Dec 2015 02:18:38 -0800

In reviewing the schema I found a number of instances where "text" is 
given as schema data type for attributes or content that isn't free-form 
text. In a number of cases that's incorrect, in others it just seems 
needlessly permissive.

As a the majority of these are clearcut bugs, I've entered this in the 
tracker.

The "type" attribute on a variant is specified as "text" - that doesn't 
work with the way action triggers need a space-separated list. So this 
must be changed to something like xsd:NMTOKEN that's reasonably broad 
but doesn't allow spaces, and the any-variant, all-variants and 
only-variants attributes on <action> elements then become NMTOKENS. That 
allows reasonable freedom in specifying variant types, but makes sure 
that those variant-trigger attributes can be the space-separated lists 
the spec calls for.

The "match" and "not-match" attributes are specified in the schema as 
"text". That is incorrect, these need to be "rule-ref", because they 
reference rules.

The "disp" attribute on <action> could reamain "text", but there seems 
little value in being so open in just that instance, therefore, I 
suggest to use xsd:NMTOKEN here as well. Some of the default 
dispositions have the same values as default variant types, so making 
both variant type and disposition the same under the schema seems the 
right thing.

After making these changes, the only non-comment attributes left as text are

(1) the "property" attribute for a class declaration, here xsd:NMTOKEN 
is general enough to capture the Unicode oriented 
"property_name:property_value" naming scheme

(2) the "id" attribute to the <lgr> element which is a feature that 
doesn't exist in the specification and, I think, should be removed.

(3) the "type" attribute on <description>. Because it contains a 
mediatype with a slash in it, using NMTOKEN won't work. I guess we could 
leave that as "text", unless someone has a better idea.