Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1750

XInclude error output to include xpointer values

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.12.2
    • None
    • XInclude 1.0

    Description

      Currently error output on failure of a resolution of an XIncludes only provides the file, i.e. href value. It would be extremely helpful to have the xpointer value bubble up in the error output so one would see both href and xpointer values. For example, I have file A referencing file B with many XIncludes pointing to different nodes and some resolve, and other purportedly fail. Having the XMLParseError message include the xpointer value would help debug problems, especially when some value resolve and others fails. (And no, the target values are in the referenced file, I just do not know at this time why there are some failures and successes and when dealing with hundreds of files with thousands of XIncludes, it is a struggle to segregate the failures.)

      I've been using Syncro Soft's Oxygen Author and made an enhancement request and was told Author simply takes what Xerces gives it as an error message. So here I am requesting Xerces provide one critical bit of information in the error message.

      To that end I have suggested two modification, each only one line of modification:

      jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $ diff src/org/apache/xerces/impl/msg/XIncludeMessages.properties ../xerces-2_12_2_work/src/org/apache/xerces/impl/msg/XIncludeMessages.properties
      37c37
      < XMLParseError = Error attempting to parse XML file (href=''{0}'').
      ---
      > XMLParseError = Error attempting to parse XML file (href=''{0}'', xpointer=''{1}'').
      jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $ diff src/org/apache/xerces/xinclude/XIncludeHandler.java ../xerces-2_12_2_work/src/org/apache/xerces/xinclude/XIncludeHandler.java
      1725c1725
      <                 reportFatalError("XMLParseError", new Object[] { href });
      ---
      >                 reportFatalError("XMLParseError", new Object[] { href, xpointer });
      jlpoole@ares /usr/local/src/xerces_2.12.2/xerces-2_12_2 $
      

      I did some preliminary tests to see if the modifications above might break something in conditions where 1) no xpointer is present, 2) xpointer = "", and 3) xpointer is invalid, e.g. xpointer="TODO:FIXME".  And the results looked encourage, but I thought I'd take it to this point and let someone familiar with the code consider these possible modifications.

      Attachments

        Activity

          People

            Unassigned Unassigned
            JohnLPoole John Poole
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: