472,328 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

How to redefine a group in a derived schema?

I'm trying to derive a schema from a base schema. I want to redefine
a "group" from the base schema in my derived schema in order to add
more options to the "choice" aggregate (see schema1.xsd sample).

schema1.xsd sample:
<!-- Here is a clipped down version of the group I want to redefine.
-->
<xsd:group name="INSURANCESVCRQMSGS">
<xsd:choice>
<xsd:element ref="HomePolicyAddRq" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="HomePolicyQuoteInqRq" minOccurs="1"
maxOccurs="1"/>
</xsd:choice>
</xsd:group>

I'd like to redefine this "group" in the derived schema so that the
end product looks something like this:

schema2.xsd sample:
<xsd:group name="INSURANCESVCRQMSGS">
<xsd:choice>
<xsd:element ref="HomePolicyAddRq" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="HomePolicyQuoteInqRq" minOccurs="1"
maxOccurs="1"/>
<xsd:element ref="MyAdditionalElement" minOccurs="1"
maxOccurs="1"/>
</xsd:choice>
</xsd:group>

I see many examples of using the "redefine" tag to redefine a
"complexType", but I can't find anything on redefining a "group". The
standard example for a complexType is something like the following,
which adds a new "generation" element to a "personName":

<xs:redefine schemaLocation="v1.xsd">
<xs:complexType name="personName">
<xs:complexContent>
<xs:extension base="personName">
<xs:sequence>
<xs:element name="generation" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:redefine>

Can anyone enlighten me as to what a group redefinition should look
like?

Thanks,
Bill
Jul 20 '05 #1
2 3176
<xsd:redefine schemaLocation="schema1.xsd">
<xsd:group name="INSURANCESVCRQMSGS">
<xsd:choice>
<xsd:group ref="INSURANCESVCRQMSGS">
<xsd:element ref="MyAdditionalElement" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:group>
</xsd:redefine>

Hope this helps

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Jul 20 '05 #2
ht@inf.ed.ac.uk (Henry S. Thompson) wrote in message news:<f5*************@erasmus.inf.ed.ac.uk>...
<xsd:redefine schemaLocation="schema1.xsd">
<xsd:group name="INSURANCESVCRQMSGS">
<xsd:choice>
<xsd:group ref="INSURANCESVCRQMSGS">
<xsd:element ref="MyAdditionalElement" minOccurs="1" maxOccurs="1"/>
</xsd:choice>
</xsd:group>
</xsd:redefine>

Hope this helps

ht


Thanks for your reply, Henry, but I had a problem with this syntax.

XMLSpy thinks that this syntax creates an unacceptable circular
reference. I went to the W3C XML tutorial
(http://www.w3c.org/TR/xmlschema-1), did a search on 'circular', and
came up with the following:

"3.8.6 Constraints on Model Group Schema Components
All model groups (see Model Groups (3.8)) must satisfy the following
constraints.

Schema Component Constraint: Model Group Correct

All of the following must be true:
1) The values of the properties of a model group must be as described
in the property tableau in The Model Group Schema Component (3.8.1),
modulo the impact of Missing Sub-components (5.3).
2) Circular groups are disallowed. That is, within the {particles} of
a group there must not be at any depth a particle whose {term} is the
group itself."

Number two seems to say that you can't have a reference to the same
group for Model Groups, even within a redefine tag. However, the
information on Attribute Groups is different, and provides an
allowance for circular references inside of a redefine tag:

"Circular group reference is disallowed outside <redefine>. That is,
unless this element information item's parent is <redefine>, then
among the [children], if any, there must not be an <attributeGroup>
with ref [attribute] which resolves to the component corresponding to
this <attributeGroup>."

So, is it impossible to redefine a Model Group, or is there some other
syntax to accomplish it?

Thanks,
Bill
Jul 20 '05 #3

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

Similar topics

0
by: Michael Bane | last post by:
Am I right in thinking that... 1) in <redefine> I can either extend OR restrict a type but not both? 2) in <redefine> it's not possible to...
1
by: Cat | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm getting a validation error when I try to restrict the content of nested groups with...
6
by: eselk | last post by:
If I have: class A { public: class some_base_class **Obj; }; And I would like to redefine "Obj" in a class derived from class A, something...
3
by: junlia | last post by:
We are using ACORD xml schema standard, and we need to add to it, so we choose to redefine ACORD xml schema. One of the problems that I ran into is...
1
by: Rumen Traykov via .NET 247 | last post by:
Have somebody had already the problem of having to write more than one XmlSchema, where some of these schemas have imports to others and...
0
by: maryam | last post by:
Hi I have a question about Redefine Keyword in XmlSchemaRedefine. According to what I have read up to now this keyword Allows simple and complex...
1
by: Peter Nofelt | last post by:
Hey All, I am having issue with serializing a class and its base class using ..net 2.0. I am using IXmlSerializable I've provided code...
0
by: bjhartin | last post by:
Hello, I'm struggling to extend the types defined in a schema. I've searched this group (and others) with no luck so far. I have the following...
2
by: ERingmae | last post by:
Hi, The environment is .NET 2.0, the language is C# and the problem is reading XSD file with xs:redefine section correctly to a...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

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.