473,381 Members | 1,452 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,381 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 3572
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
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.