On Fri, Jan 15, 2010 at 05:12:18PM +0100, Elvis Stansvik wrote:
> Hello libxml2 folks,
> 
> The following minimal example validates with Jing but not libxml2 (git
> version from today):
> 
> test.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <a b="0%"/>
> 
> schema.rng:
> <?xml version="1.0" encoding="UTF-8"?>
> <grammar
>   xmlns="http://relaxng.org/ns/structure/1.0";
>   datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
> 
>   <start>
>     <element name="a">
>       <attribute name="b">
>         <list>
>           <choice>
>             <ref name="percent"/>
>             <value>super</value>
>             <value>sub</value>
>           </choice>
>           <optional>
>             <ref name="percent"/>
>           </optional>
>         </list>
>       </attribute>
>     </element>
>   </start>
> 
>   <define name="percent">
>     <data type="string">
>       <param name="pattern">-?([0-9]+(\.[0-9]*)?|\.[0-9]+)%</param>
>     </data>
>   </define>
> 
> </grammar>
> 
> [as...@pyret test]$ xmllint --version
> xmllint: using libxml version 20706-GITv2.7.6-8-g7946137
>    compiled with: Threads Tree Output Push Reader Patterns Writer
> SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer
> XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas
> Schematron Modules Debug Zlib
> [as...@pyret test]$ xmllint --relaxng schema.rng test.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <a b="0%"/>
> Unimplemented block at relaxng.c:8948
> test.xml:2: element a: Relax-NG validity error : Element a failed to
> validate attributes
> test.xml fails to validate
> 
> It validates if I remove the entire <optional> from the <list>.
> 
> Any ideas? The code at relaxng.c:8948 indicates that this is a TODO.
> Is that true or is this a real bug and the validator has been put into
> an inconsistent state?

  Hum, yes I guess it's a bug in libvirt as the given define type seems
not supported there, that construct seems very unusual, since nobody
stepped on it ... until now !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
[email protected]  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to