Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] included getURI() in ParsingException.toString()

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Wolfgang Hoschek <whoschek AT lbl.gov>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] included getURI() in ParsingException.toString()
  • Date: Thu, 16 Jun 2005 22:08:19 -0400

Wolfgang Hoschek wrote:
For XSLT and XQuery or other programs processing lots of files, debugging would be made much easier if the URI of the current document would be included in ParsingException.toString(), if available. That way it would be immediately obvious which file causes the parsing problem. Otherwise one would need to add extra instrumentation in all sorts of places.

Here is the simple patch for ParsingException:

public String toString() {
return super.toString() + " at line "
+ lineNumber + ", column " + columnNumber + ", uri " + uri + ".";
}


That's reasonable. Looking at it now, I'd like to do a little more. Include the URI only if it's non-null and the line and column numbers only if they're not -1.


--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page