epubcheck icon indicating copy to clipboard operation
epubcheck copied to clipboard

Error in error message...

Open iherman opened this issue 3 years ago • 7 comments
trafficstars

Consider this in the package file:

  <manifest>
    <item id="content_001" properties="scripted" fallback="#fallbackid" href="content_001.xhtml" media type="application/xhtml+xml" />
    <item id="fallbackid" href="content_fallback.xhtml" media-type="application/xhtml+xml" />
    <item id="nav" properties="nav" href="nav.xhtml" media-type="application/xhtml+xml" />
  </manifest>

Epubcheck flags an error because it should be fallback="fallbackid". However, the error message says:

ERROR(RSC-005): [...]: Error while parsing file: value of attribute "fallback" is invalid; must be an XML name without colons

The problem is not a colon, the problem is a hash mark...

iherman avatar Aug 03 '22 14:08 iherman

I think this has been raised before. Epubcheck isn't telling you what you did wrong, as it only knows the pattern doesn't match. It's telling you what it expects: a non-colonized XML name (NCName).

mattgarrish avatar Sep 01 '22 10:09 mattgarrish

Yeah, this message comes from the RelaxNG schema validator (Jing). We might be able to intercept it and reword it, if anyone can suggest a better wording.

rdeltour avatar Sep 01 '22 12:09 rdeltour

Trying to make NCName human readable definitely seems to focus people on the comma being the issue.

Could it say "must be a valid ID reference (IDREF)", or is this a catch-all for all NCName validation?

mattgarrish avatar Sep 01 '22 12:09 mattgarrish

I think it is a catch-all. I'll have to double check.

rdeltour avatar Sep 05 '22 07:09 rdeltour

Yeah, this is a catch all, so it's difficult to intercept particular cases when this is raised to reword the message depending on the context.

I'm open to suggestion for something better than "an XML name without colons", but moving this out of v5.0.0 for now.

rdeltour avatar Dec 31 '22 01:12 rdeltour