Element-Mandatory Attribute declaration in XSD Schema:

后端 未结 4 1545
故里飘歌
故里飘歌 2021-02-19 15:46

I want to declare an element to be included in a complex type declaration, and the element has a mandatory attribute: \"option=MyOption\", but the value of the \"option\

4条回答
  •  逝去的感伤
    2021-02-19 16:33

    You need to modify the definition of the "SpecialOption" element to include the required attribute. Update this code:

    
    

    to this:

    
      
        
          
            
          
        
      
    
    

    With this change your complex type will contain the required "Option" attribute on all instances of the "SpecialOption" element in the "SpecialOptions" complex type. Declaring the "Option" attribute to be of type xs:string will allow any value to be passed in this field.

提交回复
热议问题