My schema file starts like this: <?xml version="1.0" encoding="UTF-8" ?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- SIMPLE TYPES --> <xs:simpleType name="my.types.bool"> <!-- this is line 5 --> <xs:restriction base="xs:string"> <xs:pattern value="([tT]([rR][uU][eE])?)|([fF]([aA][lL][sS][eE])?)|([yY]([eE][sS])?)|([nN][Oo]?)|1|0+"/> </xs:restriction> </xs:simpleType> The validator of the XML editor I'm using (XML Copy Editor) complains: Error at line 5: Element schema has extra content: simpleType What am I doing wrong? I thought this message means that I have some text outside of an XML element, but there is none (except spaces and comments), so it must be a different reason.