simplecontent that extends itself, is that valid??

Discussion in 'XML' started by Eric D, Jan 31, 2007.

  1. Eric D

    Eric D Guest

    Hi,
    is such a complex type valid?
    <xsd:complexType name="EthnicityCodeType">
    <xsd:simpleContent>
    <xsd:extension base="nibrs:EthnicityCodeType">
    <xsd:attributeGroup ref="j:SuperTypeMetadata"/>
    </xsd:extension>
    </xsd:simpleContent>
    </xsd:complexType>
    Thanks for your answers.
    Eric
     
    Eric D, Jan 31, 2007
    #1
    1. Advertising

  2. Eric D

    Guest

    On 31 Jan, 06:22, "Eric D" <> wrote:
    > Hi,
    > is such a complex type valid?
    > <xsd:complexType name="EthnicityCodeType">
    > <xsd:simpleContent>
    > <xsd:extension base="nibrs:EthnicityCodeType">
    > <xsd:attributeGroup ref="j:SuperTypeMetadata"/>
    > </xsd:extension>
    > </xsd:simpleContent>
    > </xsd:complexType>
    > Thanks for your answers.
    > Eric


    Assuming this is a definition in the namespace associated with the
    namespace prefix nibrs...

    I couldn't explicitly find text in the spec that prevents this, but
    even if it is intended to be allowed (rather than just not considered)
    I would say that it is a corner case and best avoided.

    OTOH - if nibrs:EthnicityCodeType is in a different namespace then it
    is obviously OK.

    HTH,

    Pete.
    --
    =============================================
    Pete Cordell
    Tech-Know-Ware Ltd
    for XML to C++ data binding visit
    http://www.tech-know-ware.com/lmx
    (or http://www.xml2cpp.com)
    =============================================
     
    , Jan 31, 2007
    #2
    1. Advertising

  3. Eric D

    George Bina Guest

    Hi Eric,

    You cannot do that, for more details see
    http://www.w3.org/TR/xmlschema-1/#ct-props-correct
    Point 3:
    ***
    3 Circular definitions are disallowed, except for the ·ur-type
    definition·. That is, it must be possible to reach the ·ur-type
    definition· by repeatedly following the {base type definition}.
    ***

    Best Regards,
    George
    ---------------------------------------------------------------------
    George Cristian Bina
    <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
    http://www.oxygenxml.com

    On Jan 31, 8:22 am, "Eric D" <> wrote:
    > Hi,
    > is such a complex type valid?
    > <xsd:complexType name="EthnicityCodeType">
    > <xsd:simpleContent>
    > <xsd:extension base="nibrs:EthnicityCodeType">
    > <xsd:attributeGroup ref="j:SuperTypeMetadata"/>
    > </xsd:extension>
    > </xsd:simpleContent>
    > </xsd:complexType>
    > Thanks for your answers.
    > Eric
     
    George Bina, Jan 31, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Random
    Replies:
    1
    Views:
    4,654
    Random
    Nov 19, 2004
  2. Jon Skeet
    Replies:
    5
    Views:
    2,163
    Dale King
    Jul 8, 2003
  3. David Norman
    Replies:
    3
    Views:
    744
    Peter Flynn
    Aug 4, 2004
  4. Kai Schlamp
    Replies:
    3
    Views:
    517
    Pavel Lepin
    Nov 1, 2007
  5. Thijs
    Replies:
    1
    Views:
    474
    Martin Honnen
    May 28, 2008
Loading...

Share This Page