relax-ng compact: attribute whose name matches a reg-ex

232 Views Asked by At

Is there a way in relax-ng to specify that an attribute's name must match a reg-ex. for example the data-attributes in html5.

<link rel="some-relation" href="/its-location/" data-color="blue" />

I'm hoping I can do something like...

LinkType |= (
    attribute rel { text },
    attribute data-* { text }*,
    ( attribute href_template { UriTemplate } | attribute href { Uri } )
)
1

There are 1 best solutions below

0
On

http://books.xmlschemata.org/relaxng/relax-CHP-9.html describes regular expression support in RELAX NG. To my knowledge regular expressions in RELAX NG are limited to attribute values and element content, and don't cover attribute names.