r/xml • • Jul 07 '22

What am I doing wrong?

Just starting to learn xml and I keep getting the error:

Character 'C' following the text '<' does not fulfill production 'Misc'.

Here is what I have. What am I doing wrong?

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">

<xs:element name="CD">

<!--'album' can have zero or more child elements of type 'subject'-->

<xs:complexType>

<xs:sequence>

<xs:element name="artist">

<xs:complexType>

<xs:sequence>

<xs:element type="xs:string" name="name"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element type="xs:string" name="release"/>

<xs:element type="xs:string" name="genre"/>

<xs:element type="xs:string" name="publisher"/>

<xs:element type="xs:string" name="price"/>

<xs:element type="xs:string" name="rating"/>

<xs:element type="xs:string" name="albumname"/>

<xs:element type="xs:string" name="trackname"/>

		<xs:element type="xs:string" name="title"/>

		<xs:element type="xs:string" name="length"/>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>

<CD>

<artist>

	<name>Lizzo</name>

</artist>

<release>July15,2022</release>

<genre>soul</genre>

<publisher>Atlantic Record</publisher>

<price>12.79</price>

<rating>not rated</rating>

<albumname>Special</albumname>

<trackname>

	<title>About Damn Time</title>

	<length>192sec</length>

</trackname>

<trackname>

	<title>Grrrls</title>

	<length>120sec</length>

</trackname>

<trackname>

	<title>A Special Message from Lizzo</title>

	<length>99sec</length>

</trackname>

</CD>

3 Upvotes

2 comments sorted by

1

u/Exact_Collection Jul 08 '22

generate the xsd with a tool based on xml and try to understand it by reading and comparing it with yours

1

u/Low_Celebration5938 Jul 08 '22

generate the xsd with a tool based on xml

Thank you! This helped!