I want to define an element with some restricted text and an attribute
<some_element my_attr="data">some restricted text</some_element> How can I create an element like this?
I tried:
<complexType> <simpleContent> <restriction base="string"> <pattern value="AAA"></pattern> <attribute name="newattr" type="string"></attribute> </restriction> </simpleContent> </complexType> But getting error msg:
Complex Type Definition Representation Error for type '#AnonType_childparent'. When is used, the base type must be a complexType whose content type is simple, or, only if restriction is specified, a complex type with mixed content and emptiable particle, or, only if extension is specified, a simple type. 'string' satisfies none of these conditions.
And then tried something like this
<complexType> <complexContent> <extension base="string"> <attribute name="attr" type="string"></attribute> </extension> </complexContent> </complexType> This time error was (This time I didn't add any restriction; this was for test purpose only):
Complex Type Definition Representation Error for type '#AnonType_childparent'. When is used, the base type must be a complexType. 'string' is a simpleType.
I am not getting clearly what the errors are implying? Is there some better explanation of error text available?