required element content
        Posted  
        
            by Guarava Makanili
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Guarava Makanili
        
        
        
        Published on 2010-05-27T16:03:36Z
        Indexed on 
            2010/05/27
            16:11 UTC
        
        
        Read the original article
        Hit count: 188
        
I'm trying to create xsd for an element like this:
<ElementType attr1="a" attr2 ="b">mandatory_string</ElementType>
and I want to make the mandatory_string required. What should I add to this xsd:
<xs:complexType name="ElementType">
 <xs:simpleContent>
  <xs:extension base="xs:string">
   <xs:attribute name="attr1" type="StringLength1to2" use="required"/>
   <xs:attribute name="attr2" type="StringLength1to2" use="required"/>
  </xs:extension>
 </xs:simpleContent>
</xs:complexType>
Currently is optional. What's missing?
© Stack Overflow or respective owner