473,466 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

rcase-Recurse with xs:redefine nested groups

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+nXT4hOND8iHbU9NCL NOcDmUnQCdHVOT
UPs2zeMZ5N2EIZoaAVJFFnk=
=xiKr
-----END PGP SIGNATURE-----

Jul 20 '05 #1
1 2174
Cat
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 27 Jan 2005 13:08:08 +1100, Cat wrote:
<snip/>
As I seem to understand it the problem is the same as I ran into previously
with the removal of 'pointless' xs:sequences. When I remove the second
element, through the xs:group reference, the xs:sequence holds only one
child and so becomes 'pointless' and is correctly removed at which point the
occurance range of the parent group is that of it's child element which is
(0,42) when in the original it was (1,1), the default.

I haven't worked out a solution yet but adding a dummy element to the
group stopping it from being removed does as expected make it validate.
============ BASE ===============
<?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" />
<xs:element name="dummy" type="xs:token"/>
</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 =============
<?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"/>
<xs:element name="dummy" type="xs:token"/>
</xs:sequence>
</xs:group>
</xs:redefine>
</xs:schema>
- --
Cat

http://www.ratrobot.com/java/beginner/ An absolute beginners step by
step guide on how to use java applets.
Thu Jan 27 04:42:45 UTC 2005
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFB+HFFKHRjYtwQ1QARAq1sAJ98bLRwDq8mgJ15pSLHIc xPBV/wpACeLSdV
RZQWrPa1pB1dYmfe0kYJYHQ=
=9PbM
-----END PGP SIGNATURE-----

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark | last post by:
Hi, can anyone please tell me (Given a group name) how I can retrieve just those users associated with that group using Active Directory using LDAP?? I am using the code below with not much luck...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
1
by: uiranejeb | last post by:
How can I determine the windows groups from a domain? How can I determine all the windows groups to which a user belongs to? (WindowsPrincipal says if a user belongs to a specific group. I need a...
0
by: Andrew Warren | last post by:
I have a need for a non-recursive technique to determine whether a user is a member of a specified group or any of its nested sub-groups I have read some of the posts regarding enumerating members...
0
by: Petra Hübner | last post by:
Hello Newsgroup, does anybody has an example, how can I read all the groups, who the user is member of (including nested groups) An Example would be great. Thanks Petra
4
by: Allen | last post by:
For my web-based php regex find/replace do-hickey, I need to match individual back references and wrap a tag around them so they'll be unique to the rest of the match for individual color markup. ...
1
by: Morten Fagermoen | last post by:
Hi! I have the function below that return all users in a group, but this code does not work if there are nested groups. Can anyone tell me what to change to also get the users in the nested...
10
by: Jeff Williams | last post by:
How can I get a list of the Groups both Local and Domain groups a User belongs to.
0
by: =?Utf-8?B?TWFyayBGb2Nhcw==?= | last post by:
Hi I have a very important issue I want to use .Net to search active directory, I am trying to fine groups of each user recursively with acceptable performance Problem in detail We have a big...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.