-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a2x should do syntax check using RelaxNG #27
Comments
That should be easy, the backend can tell a2x to ignore the non-zero return code. The errors don't print unless verbose anyway but maybe we always want to print "Warning: xmllint found errors, continuing anyway" |
Committed possible implementation, I don't have hg a2x or patched xmllint so it is untested, use -L to disable, use backend-opt schema=path to set the schema to use. |
Yesterday I did a rather deep investigation to the xmllint errors that are still apparent with our ODF output. I found that the OpenDocument RelaxNG schema actually seems to require a certain ordening of child-elements, e.g. for style:style parent element. The fact that xmllint (and even jing) do not make it very clear that this strict order is required makes the output confusing (and seemingly wrong). I opened a ticket during the investigation explaining the details: https://bugzilla.redhat.com/show_bug.cgi?id=790316 I also discovered that if a RelaxNG tool complains about interleave/interleaving, it basically has to do with the order of elements, and the output often is plain wrong. It complains about expecting the first element of the possible set (even if this element is not mandatory). So the error is incorrect and deceiving. Jing is often somewhat better in the error output, but xmllint is more likely to be installed. Now, with those issues resolved, xmllint return code is reliable, except that due to a bug in xmllint (unimplemented block for XML_RELAXNG_OPTIONAL) most, if not all, xmllint's in the field will fail to validate ODF documents. See: https://bugzilla.redhat.com/show_bug.cgi?id=752393 So we'll have to be very careful, maybe in a year or two most xmllint implementations have this bug fixed :-/ |
If the schema would not be that big, we could consider shipping it with asciidoc-odf... |
Thanks using a2x -L allowed it to work for me. |
Now that we have xmllint patched for proper RelaxNG syntax checking, we might want to integrate RelaxNG syntax checking of content.xml before packaging.
However, since there are still some issues with the output that are not important, maybe only do this when -v is added ? And disregard the return code until we are safe :-)
The text was updated successfully, but these errors were encountered: