XSD definition for an XML tag with attribute and content

pipinho2005

New Member
I have written an XSD and an XML. In my XML I want to have a tag like this \[code\]<main name="">My text</main>\[/code\]In my xsd I tried this\[code\]<xs:element name="main" type="xs:string"> <xs:complexType> <xs:attribute name="name" use="required" /> </xs:complexType></xs:element>\[/code\]This did not work. Can anybody tell me what is the correct way to define this in the XSD.
 
Back
Top