473,605 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ 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="unbo unded" />
</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="unbo unded"/>
</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="unbo unded"/>
</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="unbo unded"/>
</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:schemaLocat ion="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="unbo unded"/>
</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="unbo unded"/>
</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+EzsKHR jYtwQ1QARAszGAK D8+nXT4hOND8iHb U9NCLNOcDmUnQCd HVOT
UPs2zeMZ5N2EIZo aAVJFFnk=
=xiKr
-----END PGP SIGNATURE-----

Jul 20 '05 #1
1 2214
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+HFFKHR jYtwQ1QARAq1sAJ 98bLRwDq8mgJ15p SLHIcxPBV/wpACeLSdV
RZQWrPa1pB1dYmf e0kYJYHQ=
=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
1873
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 DirectoryEntry entry = new DirectoryEntry("LDAP://" + Domain,"LoginUser","Password"); DirectorySearcher Dsearch = new DirectorySearcher(entry); Dsearch.Filter = "objectCategory =All users"; // All users is a group in AD
3
6440
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 COULD be wrong... :) I've tried the access group...twice...and all I get is "Access doesn't like ".", which I know, or that my query names are too long, as there's a limit to the length of the SQL statement(s). But this works when I don't try to...
1
4446
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 list with all the groups). Thanks!
0
421
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 of groups and nested groups but as far as I can tell, all loop through enumerations of groups and manually recurse through nested groups to produce their lists. My requirement is simpler - given a user name and group name, just return true if...
0
1043
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
4499
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. Initially this would seem easy enough, however not all of a potential regex match is going to be within a back reference. So it's necessary to replace the back reference, and only the back reference, while preserving the context of the match. ...
1
3333
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 groups? Sub GetGroupMembers(ByVal ggmGroup As String, ByRef ggmMembers As
10
26789
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
1373
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 network more than 100,000 user distributed in different domains. And we have special universal groups, that belongs to many global groups So, we need per each user to test all groups even the nested groups
0
8007
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7937
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8423
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8076
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8290
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6749
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
1546
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1274
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.