relaxng / jing-trang

Schema validation and conversion based on RELAX NG
http://www.thaiopensource.com/relaxng/
Other
228 stars 69 forks source link

Confusing message "must be an XML name without colons" when an attribute's value begins with a number #174

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
First of all I'm sorry for not delivering a report, that is tracked down well. 
Anyways, you might want to have a look at it or just mark it as won't fix, so 
others searching for it can find it.

The problem occurs when using epubcheck to validate an EPUB-file. Epubcheck 
uses jing-trang. When the problem was reported as issue on the 
epubcheck-project-page, the developers referred to jing-trang and suggested 
reporting it here: "This message is indeed suboptimal, but comes from Jing, so 
EpubCheck does not really have control over the message contents. I suggest you 
report this to the jing-trang project on google code instead."

The concrete problem is, that if values of attributes beginning with a number 
do exist, the message "value of attribute "id" is invalid; must be an XML name 
without colons" is logged. This message doesn't give a good hint about what the 
actual problem is.

So if this is inappropriate for jing-trang itself, you might want to change it. 
According to the epubcheck-developers, you should be able to recognise the 
relevant part.

What steps will reproduce the problem?
1. Modify SMIL-file in EPUB3 with Media-Overlays to contain a par-element with 
an id, that begins with a number
2. Validate resulting EPUB3 with EPUBCheck (which uses jing-trang)
3. See error in log-output

What is the expected output? What do you see instead?
Expected no error, but acutally getting the message: "value of attribute "id" 
is invalid; must be an XML name without colons"

What version of the product are you using? On what operating system?
jing-trang used in epubcheck v3.0 on Mac OS X 10.8.3

Please provide any additional information below.
- Epubcheck project page: https://code.google.com/p/epubcheck/
- Epubcheck issue regarding this problem: 
https://code.google.com/p/epubcheck/issues/detail?id=193
- See above

Original issue reported on code.google.com by flie...@gmail.com on 28 Aug 2013 at 11:41

GoogleCodeExporter commented 9 years ago
Hopefully the message would be accompanied by the line-number and column-number 
of the start-tag concerned.  Assuming this is so, I do not yet understand in 
what way this message is confusing.  It is telling you which attribute has the 
problem and what the problem is.  Can you give an example of a message that 
would not have confused you?

Original comment by j...@jclark.com on 29 Aug 2013 at 11:25

andrew-burt commented 9 years ago

I see no one has followed up on this question, so I thought I would, since I just encountered the problem myself. I agree with the OP that the error message is confusing, and implies a problem with a colon character (when in fact the problem I was diagnosing was an epub where the creating software had begun the ID with a digit).

My suggested wording for the error message would be:

value of attribute "id" is invalid; must meet rules for an XML "NCName" (first character letter or underscore, followed by alphanumerics, underscores, or dashes)

A bit longer, but I think clearer, especially since the error message may be seen by people unfamiliar with XML syntax (such as authors getting error messages from "epubcheck", which uses jing-trang). :) Thanks for considering it!