Re: [xml] Missing line numbers in error handling (somewhat of a repeat of a 2002 post)

On Thu, Mar 25, 2004 at 10:04:08AM -0800, David Ascher wrote:
I'm exploring using libxml to do validating parsing in an IDE (Komodo), 
using the Python bindings.  It seems to work just fine, but I have two 

1) Small problem: it seems to be that the error handler is called once 
per line of 'error output' as opposed to being called once per error w/ 
multiline outputs, which makes parsing the error programmatically a tad

  See the new structured error functions
Stephane Bidoul provided support for those a the Python level, e.g.
the example in the python subdir.

2) Bigger problem: it seems that some errors display line numbers in the 
error messages:

      Entity: line 9:
      error :
      Opening and ending tag mismatch: foo line 7 and bodyasdas

but many aren't:

      element bodyasdas:
      error :
      No declaration for element bodyasdas
      element html:
      error :
      Element html content does not follow the DTD, expecting (head ,
      body), got (head bodyasdas )


My questions are:

0) is there a reason for the line-by-line error reporting rather than 
error-by-error reporting?  (or is it a python binding specific bug?)

  historical, use the new APIs instead

1) is the lack of consistent line numbers a bug, or rather a bug you 
care about?

  usually there is line numbers. Sometimes you can't have line numbers.
In general we try to provide them, so you may have found a bug but your
post is not explicit enough to confirm this.

2) how hard would it be to fix, and if not impossible, any pointers on 
where I should look in the code?

  "how hard" can't be answered since we don't know what might need fixing.
Most errors are processed through routines in error.c in the code source.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]