derivation, restriction, extension, ...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Benjamin Michotte

    #1

    derivation, restriction, extension, ...

    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:strin g" 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:strin g" 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

    #2
    Re: derivation, restriction, extension, ...

    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

    "Benjamin Michotte" <binny@freegate s.be> wrote in message
    news:223461c3.0 309050116.405e3 443@posting.goo gle.com...[color=blue]
    > 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:strin g" 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:strin g" fixed="bar" />
    > </extension>
    > </complexContent>
    > </complexType>
    > </element>
    >
    > of course, this is not valid !
    > How can I redifine this attribute for my derivated element ?
    >
    > thanks,
    > Benjamin[/color]


    Comment

    Working...