derivation, restriction, extension, ...

Benjamin Michotte

Usenet Archive
Joined
Sep 5, 2003
Messages
1
Reaction score
0
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
 

Bob Foster

Usenet Archive
Joined
Aug 14, 2002
Messages
220
Reaction score
0
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
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top