Re: [xml] xmllint schema validation reports line numbers above 65535 incorrectly (was: Re: Important: possible incompatible changes ahead for 2.9.0 !)

On Fri, Aug 10, 2012 at 09:24:56PM +0200, Johan Corveleyn wrote:
On Fri, Aug 10, 2012 at 11:27 AM, Daniel Veillard <veillard redhat com> wrote:
On Fri, Aug 10, 2012 at 10:03:39AM +0200, Johan Corveleyn wrote:
On Fri, Aug 10, 2012 at 9:43 AM, Daniel Veillard <veillard redhat com> wrote:
 That said there are ways to get "long" line numbers stored in adjacent
nodes c.f. xmlGetLineNo()
  But not knowing how you actually use the parser nor how you
use the schemas validation, I cant tell if you can extract full line
numbers. It should be possible in the xmlReader for example.
But I don't know how you validate, maybe this could be added, but
I have no details from you to reproduce your specific situation so ...

Thanks for the information.

The problem I'm seeing is with schema validation of xmllint. Schema
validation errors happening after line 65535 are always reported by
xmllint as line 65535. If you'd like I can draw up a quick example, or
write a script to generate such a file and then reproduce it.

So maybe that particular problem is only in xmllint's usage of the
libraries (when doing schema validation), and maybe that can be fixed
there by accessing those long line numbers?

an instance would compress very well I assume :) send that, the schemas
and show me how you're running xmllint. XSD can be validated though a
normal tree, the reader or SAX. there might be ways to get extended line
informations in all case in a controlled environment like xmllint.

Ok, here is an example in attachment (it compressed very well indeed :-)).

The xml file has a schema validation error at line 72720 (level1
element without level2 child).

When I run:

    xmllint --noout --schema test_schema.xsd test_xml.xml

I get:

    test_xml.xml:65535: element level1: Schemas validity error :
Element 'level1': Missing child element(s). Expected is ( level2 ).
    test_xml.xml fails to validate

Interestingly, the same problem is not present for parser errors. If
there is a parser error around that same line, the line number is
reported correctly.

  Okay, thanks, I will look, but no promise though :-)
Parser error get their line numbers directly from the parser context
which doesn't have the limitation. Here you are validating the built
tree and hence relying on line numbers kept in the tree...


Daniel Veillard      | libxml Gnome XML XSLT toolkit
daniel veillard com  | Rpmfind RPM search engine | virtualization library

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