derivation, restriction, extension, ...

  • Thread starter Benjamin Michotte
  • Start date
B

Benjamin Michotte

Hello,

I know this have no sense but it's a constraint from some obscure
people
working with me :/

I have a complex element which looks like
<element name="foo">
<complexType>
... some data
<attribute name="type" type="xsd:string" fixed="foo"
/>
</complexType>
</element>

and I also have an element derivating from foo
<element name="bar">
<complexType>
<complexContent>
<extension base="foo">
... some data
<attribute name="type"
type="xsd:string" fixed="bar" />
</extension>
</complexContent>
</complexType>
</element>

of course, this is not valid !
How can I redifine this attribute for my derivated element ?

thanks,
Benjamin
 
B

Bob Foster

Elements aren't derived from other elements; only types can be derived from
types.

The way to do this is to define a base type that does not have the type
attribute. Define foo with a complex type derived by extension from the base
and add the type attribute with a "foo" fixed value. Define bar with a
complex type derived by extension from the base type and add the type
attribute with a "bar" fixed value.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top