473,320 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 3298
<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 change a type from say <xs:string> to <xs:integer>? ...
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 xs:redefine whereas the same restriction on xs:element's...
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 like this maybe:
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 how to add some values to an emumerated list. ...
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 respectively derived types? The imports cannot be resolved...
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 types, groups, and attribute groups that are...
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 displaying my at the bottom of this post. Thanks ahead...
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 two schemas: <!-- foobar.xsd --> <!-- A...
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 XMLDataDocument.DataSet. What I am trying to do: I am trying...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.