Jump to content
rovf

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...