relax-ng compact: attribute whose name matches a r

2019-09-05 05:28发布

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条回答
别忘想泡老子
2楼-- · 2019-09-05 06:16

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.

查看更多
登录 后发表回答