Re: [xml] Possible bug with schema validation in combination with xsi:nil



On Thu, Feb 28, 2013 at 01:43:47PM +0100, Thomas Gamper wrote:
Am 28.02.2013 12:07, schrieb Daniel Veillard:
On Fri, Feb 08, 2013 at 02:04:34PM +0100, Thomas Gamper wrote:
[...]
So, attached you find a patch diffed against git master which fixes
the issue. There is no point doing a regexp validation of further
content if there actually *IS* no further content because the
element is nil. I also checked that validation of an element which
has xsi:nil="true" but contains child elements still fails as it
should.
  Hi TOM,

 thanks for checking the issue.
I don't know XSD very well but that seems to make sense.
However running the regression tests, "make check" now reports:
## Schemas regression tests
Result for ./test/schemas/bug323510_0.xml on
./test/schemas/bug323510_1.xsd failed
File ./test/schemas/bug323510_1.xsd generated an error
Result for ./test/schemas/choice_4.xml on ./test/schemas/choice_0.xsd
failed
File ./test/schemas/choice_0.xsd generated an error

  if I apply the patch.
So my guess is that there is a side effect to your patch. Probably
about the removale of the second test part where (ret == 0).

So I rewrote it to minimize change to existing code paths and
that smaller patch seems to work with your test case and pass
make check. The specific testsuite run is also unmodified.

So I pushed that:

http://git.gnome.org/browse/libxml2/commit/?id=c100e69c4b4be13ba760eda45f72165e684c483f

  can you double check it works for your full use case ?

   thanks !

Daniel

It's working fine. Thank you very much!

  great, thanks for the fast feedback !

Daniel

-- 
Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/


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