John Poole created XERCESJ-1750:
-----------------------------------

             Summary: XInclude error output to include xpointer values
                 Key: XERCESJ-1750
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1750
             Project: Xerces2-J
          Issue Type: Wish
          Components: XInclude 1.0
    Affects Versions: 2.12.2
            Reporter: John Poole


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:

{noformat}
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 $
{noformat}

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". 






--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to