epubcheck icon indicating copy to clipboard operation
epubcheck copied to clipboard

Inconsistent HTML fragment identifier validation

Open chrisauclair opened this issue 9 years ago • 1 comments

If a HTML id attribute value starts with a number, EPUBCheck raises no error per #706. However, any other HTML attributes that reference fragment identifiers as their value will trigger the "must be an XML name without colons" error if the identifier starts with a number. Affected attributes include for, aria-controls, and aria-labeledby.

Example: ERROR(RSC-005): example.epub/EPUB/content-doc.xhtml(7,42): Error while parsing file 'value of attribute "aria-controls" is invalid; token "78c297b2-11a8-4856-93d6-f513c9668b16" invalid; must be an XML name without colons'

chrisauclair avatar Jul 20 '17 14:07 chrisauclair

I was able to reproduce the issue, with the latest schemas on the branch next/v4.2.0. Let's handle this in the 4.2.0 stream; I created a branch fix/issue-783/idrefs that contains a repro.

The issue comes from the RelaxNG datatype of the attributes being set to datatype.IDREF, which is itself defined as xsd:NCName.

Suggested resolution:

  • loosen the type of datatype.IDREF.lexical in datatypes.rnc
  • make sure that ID/IDREFs associations are checked with Schematron

rdeltour avatar Jan 21 '19 09:01 rdeltour