hassanakbar4 / tractive-test

0 stars 0 forks source link

wrong filename displayed in error message if reference include has error #299

Closed hassanakbar4 closed 3 years ago

hassanakbar4 commented 9 years ago

component_Version 2 cli resolution_overtaken by events type_defect | by rhansen@bbn.com


With xml2rfc v2.5.0, if an included reference file has an error, the error message displays the document filename not the reference filename.

To reproduce:

  1. Create foo.xml with the following contents:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
    <rfc category="std" docName="foo" ipr="trust200902">
    <front>
    <title>foo</title>
    <author fullname="Firstname Lastname" initials="F." surname="Lastname"/>
    <date/>
    </front>
    <middle>
    <section title="Introduction">
      <t><xref target="badref"/></t>
    </section>
    </middle>
    <back>
    <references title="Normative References">
      <?rfc include="badref.xml"?>
    </references>
    </back>
    </rfc>
  2. Create ~/.cache/xml2rfc/badref.xml with the following contents:
    <?xml version='1.0' encoding='UTF-8'?>
    <reference anchor='badref'>
    <front>
    <title>badref title</title>
    <!-- missing <author/> -->
    <date/>
    </front>
    </reference>
  3. Run xml2rfc foo.xml. You'll get the following output:
    Parsing file foo.xml
    ERROR: Unable to validate the XML document: foo.xml
    foo.xml: Line 3: Element front content does not follow the DTD, expecting (title , author+ , date , area* , workgroup* , keyword* , abstract? , note*), got (title date)

Notice how the error message says foo.xml when it should say ~/.cache/xml2rfc/badref.xml.

Ideally the error would say something like this:

ERROR: Unable to validate the XML document: foo.xml
 foo.xml: Line 16: Error in included file
 ~/.cache/xml2rfc/badref.xml: Line 3: Element front content does not follow the DTD, expecting (title , author+ , date , area* , workgroup* , keyword* , abstract? , note*), got (title date)

Issue migrated from trac:299 at 2021-10-20 18:20:32 +0500

hassanakbar4 commented 9 years ago

@{"email"=>"ietf@augustcellars.com", "name"=>nil, "username"=>nil} changed owner from henrik@levkowetz.com to ietf@augustcellars.com