Jump to content

Pls. explain error message "Element schema has extra content"

Recommended Posts

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.

Share this post

Link to post
Share on other sites

The message sounds like it doesn't want a <simpleType> element inside the <schema> element. The code looks correct to me, besides missing a cosing </schema> tag, though you probably have that after the rest of the code.


Make a copy of your document and remove everything but the first <simpleType> element to see if it still complains.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now