C
Cat
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm getting a validation error when I try to restrict the content of nested
groups with xs:redefine whereas the same restriction on xs:element's validates.
============== BASE XMLSCHEMA =================
<?xml version="1.0"?>
<xs:schema targetNamespace="test" xmlns="test"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root" type="xs:token"/>
<xs:group name="groups">
<xs:sequence>
<xs:group ref="group1" minOccurs="0" maxOccurs="1"/>
<xs:group ref="group2" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:group>
<xs:group name="elements">
<xs:sequence>
<xs:element name="three" minOccurs="0" maxOccurs="1"/>
<xs:element name="four" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
<xs:group name="group1">
<xs:sequence>
<xs:element name="one" type="xs:token"/>
</xs:sequence>
</xs:group>
<xs:group name="group2">
<xs:sequence>
<xs:element name="two" type="xs:token"/>
</xs:sequence>
</xs:group>
</xs:schema>
============= REDEFINED XMLSCHEMA ============
<?xml version="1.0"?>
<xs:schema targetNamespace="test" xmlns="test"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:redefine schemaLocation="test.xsd">
<xs:group name="groups">
<xs:sequence>
<xs:group ref="group1" minOccurs="0" maxOccurs="0"/>
<xs:group ref="group2" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
<xs:group name="elements">
<xs:sequence>
<xs:element name="three" minOccurs="0" maxOccurs="0"/>
<xs:element name="four" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
</xs:redefine>
</xs:schema>
============ XML FILE ===================
<?xml version="1.0"?>
<root xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns="test" xsi:schemaLocation="test xsd/test2.xsd"/>
=========================================
I get the following error message.
rcase-Recurse.1: Group's occurrence range, (0,unbounded), is not a valid
<wrapped>-->restriction of base group's occurrence range, (1,1).
Column: 27 Line: 5
src-redefine.6.2.2: Group 'groups' does not properly restrict the group it
<wrapped>-->redefines; constraint violated: 'rcase-Recurse.1'.
Column: 27 Line: 5
and curiously if I change the maxOccurs for the *other* element to a random
value such as 42 I get the following error message.
================= NEW BASE XMLSCHEMA ==========
<?xml version="1.0"?>
<xs:schema targetNamespace="test" xmlns="test"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root" type="xs:token"/>
<xs:group name="groups">
<xs:sequence>
<xs:group ref="group1" minOccurs="0" maxOccurs="1"/>
<xs:group ref="group2" minOccurs="0" maxOccurs="42" /> <!--NOTE-->
</xs:sequence>
</xs:group>
<xs:group name="elements">
<xs:sequence>
<xs:element name="three" minOccurs="0" maxOccurs="1"/>
<xs:element name="four" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
<xs:group name="group1">
<xs:sequence>
<xs:element name="one" type="xs:token"/>
</xs:sequence>
</xs:group>
<xs:group name="group2">
<xs:sequence>
<xs:element name="two" type="xs:token"/>
</xs:sequence>
</xs:group>
</xs:schema>
================== NEW REDEFINED XMLSCHEMA =========
<?xml version="1.0"?>
<xs:schema targetNamespace="test" xmlns="test"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:redefine schemaLocation="test.xsd">
<xs:group name="groups">
<xs:sequence>
<xs:group ref="group1" minOccurs="0" maxOccurs="0"/>
<xs:group ref="group2" minOccurs="0" maxOccurs="42"/> <!--NOTE-->
</xs:sequence>
</xs:group>
<xs:group name="elements">
<xs:sequence>
<xs:element name="three" minOccurs="0" maxOccurs="0"/>
<xs:element name="four" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
</xs:redefine>
</xs:schema>
=======================================================
with the xml file unchanged I get the following error message. Note the 42!
<!--NOTE-->
rcase-Recurse.1: Group's occurrence range, (0,42), is not a valid restriction
<wrapped>-->of base group's occurrence range, (1,1).
Column: 27 Line: 5
src-redefine.6.2.2: Group 'groups' does not properly restrict the group it
<wrapped>-->redefines; constraint violated: 'rcase-Recurse.1'.
Column: 27 Line: 5
I am using the xerces 2.6.2 from J2SE 5.0
- --
Cat
http://www.ratrobot.com/programming/shell/ Some simple shell
scripts and my bash prompt. Free for any use by anyone.
Thu Jan 27 02:07:40 UTC 2005
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFB+EzsKHRjYtwQ1QARAszGAKD8+nXT4hOND8iHbU9NCLNOcDmUnQCdHVOT
UPs2zeMZ5N2EIZoaAVJFFnk=
=xiKr
-----END PGP SIGNATURE-----
Hash: SHA1
I'm getting a validation error when I try to restrict the content of nested
groups with xs:redefine whereas the same restriction on xs:element's validates.
============== BASE XMLSCHEMA =================
<?xml version="1.0"?>
<xs:schema targetNamespace="test" xmlns="test"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root" type="xs:token"/>
<xs:group name="groups">
<xs:sequence>
<xs:group ref="group1" minOccurs="0" maxOccurs="1"/>
<xs:group ref="group2" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:group>
<xs:group name="elements">
<xs:sequence>
<xs:element name="three" minOccurs="0" maxOccurs="1"/>
<xs:element name="four" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
<xs:group name="group1">
<xs:sequence>
<xs:element name="one" type="xs:token"/>
</xs:sequence>
</xs:group>
<xs:group name="group2">
<xs:sequence>
<xs:element name="two" type="xs:token"/>
</xs:sequence>
</xs:group>
</xs:schema>
============= REDEFINED XMLSCHEMA ============
<?xml version="1.0"?>
<xs:schema targetNamespace="test" xmlns="test"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:redefine schemaLocation="test.xsd">
<xs:group name="groups">
<xs:sequence>
<xs:group ref="group1" minOccurs="0" maxOccurs="0"/>
<xs:group ref="group2" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
<xs:group name="elements">
<xs:sequence>
<xs:element name="three" minOccurs="0" maxOccurs="0"/>
<xs:element name="four" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
</xs:redefine>
</xs:schema>
============ XML FILE ===================
<?xml version="1.0"?>
<root xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns="test" xsi:schemaLocation="test xsd/test2.xsd"/>
=========================================
I get the following error message.
rcase-Recurse.1: Group's occurrence range, (0,unbounded), is not a valid
<wrapped>-->restriction of base group's occurrence range, (1,1).
Column: 27 Line: 5
src-redefine.6.2.2: Group 'groups' does not properly restrict the group it
<wrapped>-->redefines; constraint violated: 'rcase-Recurse.1'.
Column: 27 Line: 5
and curiously if I change the maxOccurs for the *other* element to a random
value such as 42 I get the following error message.
================= NEW BASE XMLSCHEMA ==========
<?xml version="1.0"?>
<xs:schema targetNamespace="test" xmlns="test"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root" type="xs:token"/>
<xs:group name="groups">
<xs:sequence>
<xs:group ref="group1" minOccurs="0" maxOccurs="1"/>
<xs:group ref="group2" minOccurs="0" maxOccurs="42" /> <!--NOTE-->
</xs:sequence>
</xs:group>
<xs:group name="elements">
<xs:sequence>
<xs:element name="three" minOccurs="0" maxOccurs="1"/>
<xs:element name="four" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
<xs:group name="group1">
<xs:sequence>
<xs:element name="one" type="xs:token"/>
</xs:sequence>
</xs:group>
<xs:group name="group2">
<xs:sequence>
<xs:element name="two" type="xs:token"/>
</xs:sequence>
</xs:group>
</xs:schema>
================== NEW REDEFINED XMLSCHEMA =========
<?xml version="1.0"?>
<xs:schema targetNamespace="test" xmlns="test"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:redefine schemaLocation="test.xsd">
<xs:group name="groups">
<xs:sequence>
<xs:group ref="group1" minOccurs="0" maxOccurs="0"/>
<xs:group ref="group2" minOccurs="0" maxOccurs="42"/> <!--NOTE-->
</xs:sequence>
</xs:group>
<xs:group name="elements">
<xs:sequence>
<xs:element name="three" minOccurs="0" maxOccurs="0"/>
<xs:element name="four" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>
</xs:redefine>
</xs:schema>
=======================================================
with the xml file unchanged I get the following error message. Note the 42!
<!--NOTE-->
rcase-Recurse.1: Group's occurrence range, (0,42), is not a valid restriction
<wrapped>-->of base group's occurrence range, (1,1).
Column: 27 Line: 5
src-redefine.6.2.2: Group 'groups' does not properly restrict the group it
<wrapped>-->redefines; constraint violated: 'rcase-Recurse.1'.
Column: 27 Line: 5
I am using the xerces 2.6.2 from J2SE 5.0
- --
Cat
http://www.ratrobot.com/programming/shell/ Some simple shell
scripts and my bash prompt. Free for any use by anyone.
Thu Jan 27 02:07:40 UTC 2005
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFB+EzsKHRjYtwQ1QARAszGAKD8+nXT4hOND8iHbU9NCLNOcDmUnQCdHVOT
UPs2zeMZ5N2EIZoaAVJFFnk=
=xiKr
-----END PGP SIGNATURE-----