XSD keyRef

Discussion in 'XML' started by Kent B, Nov 15, 2005.

  1. Kent B

    Kent B Guest

    Hello people,

    Sorry if this is the wrong newsgroup. I had a look and couldn't find a
    more appropriate one for XSD.

    I have a complex type defined in its own schema as follows:

    <xsd:complexType name="myType">
    <xsd:complexContent>
    <xsd:extension base="myBaseType">
    <xsd:attribute name="parentId" type="xsd:string" use="optional"/>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>

    I want to apply a keyRef so that the parentId attribute must refer to a

    valid ID (defined elsewhere in another schema). However, as far as I
    can
    tell, XSD only allows you to specify a keyRef inside an element
    declaration.
    But I don't want to declare an element. Does anyone know how I can
    declare a
    keyRef without requiring the element?

    Thanks,
    Kent
    Kent B, Nov 15, 2005
    #1
    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. Marek Malowidzki

    Key/keyref validation in schema?

    Marek Malowidzki, Aug 18, 2003, in forum: XML
    Replies:
    1
    Views:
    492
    Mark Preston
    Aug 19, 2003
  2. J E E
    Replies:
    0
    Views:
    360
    J E E
    Nov 7, 2003
  3. peterpeter
    Replies:
    0
    Views:
    916
    peterpeter
    Feb 11, 2004
  4. Replies:
    0
    Views:
    2,167
  5. boeledi

    XSD: key and keyref problem

    boeledi, Oct 15, 2007, in forum: XML
    Replies:
    4
    Views:
    1,131
    Kris824
    Sep 6, 2012
Loading...

Share This Page