473,549 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="INSURANCE SVCRQMSGS">
<xsd:choice>
<xsd:element ref="HomePolicy AddRq" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="HomePolicy QuoteInqRq" 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="INSURANCE SVCRQMSGS">
<xsd:choice>
<xsd:element ref="HomePolicy AddRq" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="HomePolicy QuoteInqRq" minOccurs="1"
maxOccurs="1"/>
<xsd:element ref="MyAddition alElement" minOccurs="1"
maxOccurs="1"/>
</xsd:choice>
</xsd:group>

I see many examples of using the "redefine" tag to redefine a
"complexTyp e", 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:complexTy pe name="personNam e">
<xs:complexCont ent>
<xs:extension base="personNam e">
<xs:sequence>
<xs:element name="generatio n" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexConte nt>
</xs:complexType>
</xs:redefine>

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

Thanks,
Bill
Jul 20 '05 #1
2 3339
<xsd:redefine schemaLocation= "schema1.xs d">
<xsd:group name="INSURANCE SVCRQMSGS">
<xsd:choice>
<xsd:group ref="INSURANCES VCRQMSGS">
<xsd:element ref="MyAddition alElement" 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.xs d">
<xsd:group name="INSURANCE SVCRQMSGS">
<xsd:choice>
<xsd:group ref="INSURANCES VCRQMSGS">
<xsd:element ref="MyAddition alElement" 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
1673
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>? 3) if I have schema1.xsd with <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
1
2199
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 validates. ============== BASE XMLSCHEMA ================= <?xml version="1.0"?> <xs:schema targetNamespace="test" xmlns="test"...
6
5867
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
3592
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. For an emumerated list like this: <xsd:complexType name="AttachmentType"> <xsd:simpleContent> <xsd:restriction base="OpenEnum"> <xsd:enumeration...
1
1521
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 until I dont save all schemas to disk, but I cannot do this because I get an error for the derived types(which have base types from schema which is...
0
791
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 obtained from external schema files to be redefined in the current schema. Can you edit the defenition of some of the elemets that are already present in...
1
831
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 of time for any help or feedback. Cheers, Peter
0
1285
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 'base' schema which will be 'extended' by customer specific ones --> <xs:schema ...>
2
5829
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 to create a DataSet object from an XSD file by using XMLDataDocument class.
0
7541
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...
0
7734
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. ...
0
7979
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...
1
7497
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...
0
7826
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...
0
6065
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...
0
5107
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1960
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
781
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...

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.