1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00

Added regression a test provided by Heiko Oberdiek (bug #303566).

* test/schemas/bug303566_1* result/schemas/bug303566_1_1*:
  Added regression a test provided by Heiko Oberdiek (bug #303566).

  level for XML Schema IDCs (bug #303566 reported by Heiko Oberdiek).
  This should not affect pattern-like resolution on every level.
This commit is contained in:
Kasimier T. Buchcik 2005-05-10 09:16:19 +00:00
parent 22678566b8
commit 3eec790cdc
5 changed files with 91 additions and 2 deletions

View File

@ -1,8 +1,13 @@
Tue May 10 11:11:26 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* test/schemas/bug303566_1* result/schemas/bug303566_1_1*:
Added regression a test provided by Heiko Oberdiek (bug #303566).
Mon May 9 17:56:58 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* pattern.c: Changed the XPath "." to resolve only on the first
level for XML Schema IDCs. This should not affect pattern-like
resolution on every level.
level for XML Schema IDCs (bug #303566 reported by Heiko Oberdiek).
This should not affect pattern-like resolution on every level.
Sun May 8 13:35:39 CEST 2005 Daniel Veillard <daniel@veillard.com>

View File

@ -0,0 +1 @@
./test/schemas/bug303566_1.xml fails to validate

View File

@ -0,0 +1 @@
./test/schemas/bug303566_1.xml:9: element Part: Schemas validity error : Element 'Part' [keyRef 'PartRefCountryDummy']: No match found for key reference ['B'].

View File

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<Test
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="bug303566_1.xsd">
<Country code="D">
<City name="Berlin"
code="B">
<Part country="D"/>
<Part country="B"/>
</City>
</Country>
<Country code="F">
<City name="Paris" code="P">
<Part country="F"/>
<Part country="F"/>
</City>
</Country>
</Test>

View File

@ -0,0 +1,63 @@
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="codeType">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z]+"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="Test">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Country"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Country">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="City"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="code"
type="codeType"
use="required"/>
</xsd:complexType>
<xsd:key name="CountryDummyKey">
<xsd:selector xpath="."/>
<xsd:field xpath="@code"/>
</xsd:key>
<xsd:keyref name="PartRefCountryDummy"
refer="CountryDummyKey">
<xsd:selector xpath=".//Part"/>
<xsd:field xpath="@country"/>
</xsd:keyref>
</xsd:element>
<xsd:element name="City">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Part"
minOccurs="2"
maxOccurs="2"/>
</xsd:sequence>
<xsd:attribute name="name"
type="xsd:string"
use="required"/>
<xsd:attribute name="code"
type="xsd:string"
use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="Part">
<xsd:complexType>
<xsd:attribute name="country"
type="codeType"
use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>