xproc / 3.0-steps

Repository for change requests to the standard step library and for official extension steps
10 stars 7 forks source link

Use of `as="xs:token"` is an error #490

Closed ndw closed 2 years ago

ndw commented 2 years ago

We have a number of steps that declare an option with enumerated values like so:

<p:option name="name" as="xs:token" values="('a','b','c')" select="'a'"/>

I believe this is an error. The default value 'a' is a xs:string, xs:string is not a subtype of xs:token, and so the default value is statically an invalid type. That's bad. We could fix this with value="xs:token('a')", but then you'd have to use xs:token() whenever you wanted to specify the value, so users would hate us. 😄

Given that we're going to check the supplied value agains the list of values, there's no benefit in type checking against xs:token, or even xs:string, we should just remove the as type.

gimsieke commented 2 years ago

Ok