Ok, this has to be easy, but I can't find a decent explanation or example of how to do it...
I want to specify that one of my XML elements can have some attributes, and that the element content must be non-blank text. For example, this is valid:
<person age="30">Bob</person>
but these constructs are invalid because the element text is missing:
<person age="30"></person>
<person age="30" />
FWIW, my existing schema (fragment), which does NOT enforce the "required text content" rule, looks like this. I assume that I want to add an xs:restriction block somewhere in this model, but I can't figure out where it belongs.
<xs:element name="person">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="age" type="xs:int" use="optional" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>