Good day,
I am writing a small XML Schema validation benchmark (so far
libxml2 kicks
ass of all general-purpose validating XML parsers for C/C++
that I could
get my hand on) and stumbled upon this bug in libxml2 2.6.26
(Debian
unstable). The attached test.xml, when parsed and validated
with libxml2,
results in the following error:
Schemas validity error : Element '{http://www.codesynthesis.com/xmlns/xsdbench/structure}p
each': This element is not expected. Expected is one of (
{http://www.codesynthesis.com/xmlns/xsdbench/structure}a
pple, {http://www.codesynthesis.com/xmlns/xsdbench/structure}o
range, {http://www.codesynthesis.com/xmlns/xsdbench/structure}m
ango ).
hth,
-boris
--
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis
.com
Open Source Cross-Platform C++ XML Data Binding
<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/20
01/XMLSchema"
xmlns:s="http://www.codesynthesis.com/xmlns/xsdbench/structure&
quot;
targetNamespace="http://www.codesynthesis.com/xmlns/xsdbench/structure&
quot;
elementFormDefault="qualified">
<complexType name="Base">
<sequence minOccurs="0"
maxOccurs="unbounded">
<element name="apple"
type="string" minOccurs="0"
maxOccurs="1"/>
<element name="orange"
type="string" minOccurs="0"
maxOccurs="unbounded"/>
<element name="mango"
type="string" minOccurs="1"
maxOccurs="1"/>
<element name="grapefruit"
type="string" minOccurs="1"
maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="Extension">
<complexContent>
<extension base="s:Base">
<choice minOccurs="0"
maxOccurs="unbounded">
<element name="peach"
type="string" minOccurs="0"
maxOccurs="1"/>
<element name="apricot"
type="string" minOccurs="0"
maxOccurs="unbounded"/>
<element name="tangerine"
type="string" minOccurs="1"
maxOccurs="1"/>
<element name="banana"
type="string" minOccurs="1"
maxOccurs="unbounded"/>
</choice>
</extension>
</complexContent>
</complexType>
<element name="structure">
<complexType>
<sequence>
<element name="extension"
type="s:Extension"
maxOccurs="unbounded"/>
</sequence>
</complexType>
</element>
</schema>
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
xml gnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
|