validation - XML Schema and element with type string -


I'm trying to create an XML schema and I'm stuck. It looks like I can not define an element with string content What am I doing?

Schema:

  & lt ;? XML version = "1.0"? & Gt; & Lt; Xs: schema xmlns: xs = "http://www.w3.org/2001/XMLSchema" xmlns = "http://ponderka.wz.cz/MusicLibrary0" targetNamespace = "http: //ponderka.wz cz / MusicLibrary0 "& Gt; & Lt; Xs: element name = "music-library" & gt; & Lt; XS: complexType & gt; & Lt; XS: Sequence & gt; & Lt; Xs: element name = "artist" type = "x: string" /> & Lt; / XS: sequence & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt; & Lt; / XS: Schema & gt;  

Doc:

   

The verifier says:

element & lt; Artist & gt; Element & lt; Music-library & gt; Not allowed under Reason: Expecting the following elements at this place (see below) & lt; Artist & gt; Error Location: Music-Library / Artist Details CVC-Model-Group: Element & lt; Artist & gt; Unexpected by the '{anonymous}' type of element & lt; Music-library & gt; Cvc-elt.5.2.1: element & lt; Music-library & gt; The actual type definition is not valid in relation to {anonymity}

you remember it Are:

  attributeFormDefault = "unqualified"  

Try it out:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; xs: schema xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" Attributform default = "unqualified" Ttwform default = "qualified" Lkshyanamshaili = "Http://ponderkakwzkcz/MusicLibrary0 "Xmlns: xs =" http://www.w3.org/2001/XMLSchema "& gt; & Lt; Xs: element name = "music-library" & gt; & Lt; XS: complexType & gt; & Lt; XS: Sequence & gt; & Lt; Xs: element name = "artist" type = "x: string" /> & Lt; / XS: sequence & gt; & Lt; / XS: complexType & gt; & Lt; / XS: element & gt; & Lt; / XS: Schema & gt;  

Comments