How to redefine a group in a derived schema?

B

BillD

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
 
H

Henry S. Thompson

<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: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
B

BillD

<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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top