Results 1 to 2 of 2

Thread: XSD question: Optional Elements...

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Question XSD question: Optional Elements...

    I have the following XSD code:
    Code:
    <xs:element name="Job" maxOccurs="unbounded">
     <xs:complexType>
       <xs:sequence>
    
         <xs:element name="Element1" type="xs:string"/>
         <xs:element name="Element2" type="xs:string" minOccurs="0"/>
    
      </xs:sequence>
     </xs:complexType>
    </xs:element>
    I'm trying to make the first element compulsory and the second element optional. But when I validate documents against this schema that do not contain <Element2>, I get a validation error claiming that a required element is missing...
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  2. #2

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796
    Oh, don't worry...it does seem to work now...
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

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