By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,081 Members | 861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,081 IT Pros & Developers. It's quick & easy.

How to redefine a group in a derived schema?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
<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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.