GNOME Bugzilla – Bug 531473
xmllint shows wrong filename in error message
Last modified: 2021-07-05 13:26:05 UTC
Please describe the problem: I use entities to construct a modular xml file. Specifcally, I write a <book> that is composed of several <chapters>. The main file book.xml uses entities refer to the chapter files (ch1.xml, ch2.xml, etc.). If there is an error in one of the <chapter> files, xmllint (sometimes? always?) reports that the error occurred in book.xml. Steps to reproduce: 1. Extract all files from the uploaded archive wrong_msg.tar.bz2 2. Run 'xmllint --relaxng docbook.rng main.xml' Actual results: 3. You will see the following message (and others): main.xml:5: element para: Relax-NG validity error : Did not expect element para there 4. There is no <para> at line 5 in main.xml. The <para> is at line 5 in file1.xml. By the way, the problem is that the docbook namespace is not declared. I need to write <para xmlns="http://docbook.org/ns/docbook">. Expected results: I expect to see: file1.xml:5: element para: Relax-NG validity error : Did not expect element para there (etc.) Does this happen every time? I think that some errors are reported correctly, and some are not. The example that I have provided, of course, produces the every time. Other information: Now that I have reached the end, I realise that there is no way for me to upload the archive. I will submit the bug anyway an dlook for a way to upload the archive.
Created attachment 110383 [details] Bzipped tar file containing sample files to reproduce the error file1.xml - contains error (missing namespace declaration). This file is included in the mainproject file main.xml via entity. main.ent - entity file containing an entry for file1.xml main.xml - main project file docbook.rng - Relax-NG schema file used to validate main.xml
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.