473,396 Members | 1,884 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,396 software developers and data experts.

problem in redefine xml schema

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 value="040"/>
<xsd:enumeration value="041"/>
<xsd:enumeration value="042"/>
...
<xsd:enumeration value="YDQ"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>

I would like to be able to add something like these to the list:
<xsd:enumeration value="abc"/>
<xsd:enumeration value="xyz"/>

But I got when validated with MS parser(.net version): "The complexType
'http://www.ACORD.org/standards/PC_Surety/ACORD1.6.0/xml/:AttachmentType' has
already been declared. An error ed in file: ///c:/myschema.xsd, (48,3)".
However, it was valid with xml spy.

Any thoughts?
Nov 12 '05 #1
3 3573
Hello,

You can't extend a simple type to add more enumerated values, even when
using redefine. The best you can do is create a new simple type that is the
union of the ACORD type plus your extra values, for example:

<xs:simpleType name="NewAttachmentType">
<xs:union memberTypes="AttachmentType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="abc"/>
<xs:enumeration value="xyz"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>

Hope that helps,
Priscilla
------------------------------------------------------------------
Priscilla Walmsley
Author, Definitive XML Schema / XML in Office 2003
http://www.datypic.com
------------------------------------------------------------------

"junlia" <ju****@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
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 value="040"/>
<xsd:enumeration value="041"/>
<xsd:enumeration value="042"/>
...
<xsd:enumeration value="YDQ"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>

I would like to be able to add something like these to the list:
<xsd:enumeration value="abc"/>
<xsd:enumeration value="xyz"/>

But I got when validated with MS parser(.net version): "The complexType
'http://www.ACORD.org/standards/PC_Surety/ACORD1.6.0/xml/:AttachmentType'
has
already been declared. An error ed in file: ///c:/myschema.xsd, (48,3)".
However, it was valid with xml spy.

Any thoughts?

Nov 12 '05 #2
Thanks for the help, Priscilla,

My problem for creating a new simple type is that we would have to redefine
ton's complextypes, which use the AttachmentType in ACORD. That would open
cans of worms.

I really don't get it why the redefine functionality is so limited, hardly
provide much modularity. We can not extend a simple type ; we can not
restrict a complex type such as restrict <xsd:element ref="ContractNumber"
minOccurs="0"/> to be <xsd:element ref="ContractNumber" minOccurs="1"/> in
the following example:
<xsd:complexType name="Requestor_Type">
<xsd:sequence>
<xsd:group ref="REQUESTORPARTY_CHOICE" minOccurs="0"/>
<xsd:element ref="ContractNumber" minOccurs="0"/>
<xsd:element ref="ProducerSubCode" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="id" type="ID"/>
</xsd:complexType>

Any idea if W3.org would provide more flexibility for redefine an existing
complex schema, such as ACORD standard?

Thanks much for the suggestions,
Junlia
"Priscilla Walmsley" wrote:
Hello,

You can't extend a simple type to add more enumerated values, even when
using redefine. The best you can do is create a new simple type that is the
union of the ACORD type plus your extra values, for example:

<xs:simpleType name="NewAttachmentType">
<xs:union memberTypes="AttachmentType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="abc"/>
<xs:enumeration value="xyz"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>

Hope that helps,
Priscilla
------------------------------------------------------------------
Priscilla Walmsley
Author, Definitive XML Schema / XML in Office 2003
http://www.datypic.com
------------------------------------------------------------------

"junlia" <ju****@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
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 value="040"/>
<xsd:enumeration value="041"/>
<xsd:enumeration value="042"/>
...
<xsd:enumeration value="YDQ"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>

I would like to be able to add something like these to the list:
<xsd:enumeration value="abc"/>
<xsd:enumeration value="xyz"/>

But I got when validated with MS parser(.net version): "The complexType
'http://www.ACORD.org/standards/PC_Surety/ACORD1.6.0/xml/:AttachmentType'
has
already been declared. An error ed in file: ///c:/myschema.xsd, (48,3)".
However, it was valid with xml spy.

Any thoughts?


Nov 12 '05 #3
"junlia" <ju****@discussions.microsoft.com> wrote in message news:D6**********************************@microsof t.com...
redefine an existing complex schema, such as ACORD standard?
Now, what exactly does that mean? Redefine the *standard*?
It wouldn't be very standard if you redefined it, now would it?

If I write an application that reads your P&C XML, how is it
supposed to know what your custom AttachmentTypes mean?
Isn't specifying a MIMEType enough?

I really don't get it why the redefine functionality is so limited, hardly
provide much modularity.


From my experience with XMLife, which is another ACORD
vocabulary that I believe shares several common design prin-
ciples as far as it's schema goes, considerable discussion and
development went into specifying extensibility points for adding
arbitrary content. There are KeyValues for "enumerated" value
types and OLifeExtension elements marked as type xs:any that
can contain arbitrarily complex, if untyped, content.

Any custom content you place in an OLEx element should,
of course, be scoped within your own namespace URI so it
doesn't conflict with other vendors who've placed extension
information there.
Derek Harmon
Nov 12 '05 #4

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>? ...
2
by: BillD | last post by:
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...
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...
2
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any...
6
by: trexim | last post by:
Hi, I am trying to create a Web Reference for CSTA using the URL http://www.ecma-international.org/standards/ecma-348/csta-wsdl/csta-wsdl-all-operations.wsdl Visual .Net complains that: "...
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...
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...
0
by: Olegi | last post by:
Hi! I don't know if this is right place to ask, but I tryed many places and still don't have an answer :-( I have application that uses complex XSD schemas. Also some elements & types can be...
0
by: scissors | last post by:
Is there a way in XML Schema to prohibit the use of <redefine>?? Thanks in advance
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.