I'd like to validate an element having a string attribute and a string value :
<?xml version="1.0" encoding="UTF-8"?>
<name sex="M">eric</name>
I used :
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="name">
<xs:complexType>
<xs:restriction base="xs:string"/>
<xs:attribute name="sex" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>
It says the the content is not valid.
The doc says that an element with an attribute is always "complexType". If I omit the xs:restriction line, the content must be empty. But I want a string value in it ("eric").
What should be the XSD code ?
PS: I'd like to avoid the ugly 'mixed="true"'