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

How can I redefine an element in an extended type?

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 ...>
<xs:complexType name="foo">
<xs:sequence>
<xs:element name="fooName" type="xs:string"/>
<xs:element name="bar" type="bar"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="bar">
<xs:sequence>
<xs:element name="barName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>

<!-- customerA-foobar.xsd -->
<!-- A version of the base schema for customer A -->
<xs:schema ...>
<xs:complexType name="customerAFoo">
<xs:complexContent>
<xs:extension base="foo">
<xs:sequence>
<xs:element name="fooCode" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="customerABar">
<xs:complexContent>
<xs:extension base="bar">
<xs:sequence>
<xs:element name="barCode" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>

I need to redefine the 'bar' element in 'customerAFoo' so that it's
type is a 'customerABar', but that isn't allowed for 'xs:extension'
unless I use 'xs:redefines'. 'xs:redefines' isn't working for me
because I'm using the XMLBeans tool to generate Java classes from these
schema, and when I use 'xs:redefines', XMLBeans doesn't understand that
customerAFoo extends foo, etc.

Is there another way to express the fact that, for a customerAFoo, the
'bar' element should be a 'customerABar'? Should I be using
substitution groups or xsi:type somewhere?

Thanks for your help.

Apr 11 '06 #1
0 1272

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>? ...
0
by: Maciej Zoltowski | last post by:
Hi, I've got a following problem with the order of fields in extended element: let's assume, that I have a complex type with a few fields, that I want to extend with additional field. In...
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...
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. ...
2
by: emma_middlebrook | last post by:
Hi <ClubNight Name = "Go club" Date = "2006-09-09"> Discussed a few simple proverbs. <Attendee Name = "RJ"/> <Attendee Name = "TT"/> <Attendee Name = "RB"/> </ClubNight> I'm trying to work...
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...
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: icesign | last post by:
I know that the selector of these elements has a scope relative to the element being declared, but maybe there is a way to get beyond bounds of this scope or maybe just a way to extend base element?...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...
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...

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.