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



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 problems:

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

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

        Entity: line 9:
        parser
        error :
        Opening and ending tag mismatch: foo line 7 and bodyasdas
        
        </bodyasdas>
        
                    ^

but many aren't:

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

        </html>
        
               ^

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?)

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

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

Thanks,

-- David Ascher





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