Results 1 to 2 of 2

Thread: Question on CHOICE restriction in XSD [RESOLVED]

  1. #1

    Thread Starter
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Question on CHOICE restriction in XSD [RESOLVED]

    I'm writing an XSD to be used for data import... (trust me this question is easy just verbose)


    I have an object called Contact. Now, a Contact can be a PERSON, BUSINESS, or AGENCY REPRESENTATIVE. A Contact also contains other elements about a contact (phones, addreesses, etc)...

    I would love for the XSD to be able to validate an xml file input like this...
    <CONTACT>
    <PERSON>...</PERSON>
    <PHONENUMBER />
    <CALLSMADE />
    </CONTACT>

    <CONTACT>
    <BUSINESS />
    <PHONENUMBER>
    <CALLSMADE />
    </CONTACT>



    In this way, I can restrict the first element thats fall under the CONTACT element, to either a PERSON, BUSINESS, or AGENCY REP.

    However, I can't seem to figure out how to make this restriction without inserting an intermediate container element to restrict those choices..

    Using my intermediary way... I would have to have this for the XML input..
    <CONTACT>
    <ENTITYTYPE>
    <PERSON>
    </ENTITYTYPE>
    <PHONES />
    <CALLSMADE />
    </CONTACT>

    I don't think that's right, because it seems unnecessary to have to define an ENTITYTYPE just to restrict to three values...

    Any help on this would be appreciated..
    Last edited by nemaroller; Sep 10th, 2004 at 09:33 AM.

  2. #2

    Thread Starter
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Never mind, got it resolved....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width