Re: [xmljs-users] Q: catching a DOMException, retrieving line and column
Brought to you by:
djoham,
witchhunter
From: Dmitry K. <dmi...@ya...> - 2007-10-09 20:56:24
|
Hi Simon, there is a line in 'xmlw3cdom.js' file, '_parseLoop' method (line 554, it is commented): // alert("Fatal Error: " + p.getContent() + "\nLine: " + p.getLineNumber() + "\nColumn: " + p.getColumnNumber() + "\n"); By uncommenting this line, you'll get your debug information. Hope it helps, - Dmitry Khudorozhkov, maintainer of XML-for-SCRIPT. Simon Ottenhaus <sim...@we...> wrote: Hi all, I'm using the DOMImplementation of XML for to parse user-written xml. So syntax errors are likely. My code is: var parser = new DOMImplementation(); try { var domDoc = parser.loadXML(sXml); } catch (e) { var sCode = parser.translateErrCode(e.code); } How do I retrieve the line and the column where the error occurred? The XMLP-parser provides getLineNumber and getColumnNumber, but the parser-object used in xmlw3cdom.js (line 177) cannot be accessed from outside. Excuse my english, please ;) Greetings Simon ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ xmljs-users mailing list xml...@li... https://lists.sourceforge.net/lists/listinfo/xmljs-users --------------------------------- Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. |