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: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] included getURI() in ParsingException.toString()
  • Date: Thu, 16 Jun 2005 19:30:28 -0700

Great :-)

On Jun 16, 2005, at 7:08 PM, Elliotte Harold wrote:

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