xsd - What is wrong with extending an XML Schema type using xs:all? -


<?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns="http://tempuri.org/servicedescription.xsd" xmlns:mstns="http://tempuri.org/servicedescription.xsd" xmlns:xs="http://www.w3.org/2001/xmlschema" targetnamespace="http://tempuri.org/servicedescription.xsd" elementformdefault="qualified" id="servicedescription">     <xs:element name="template">         <xs:complextype>             <xs:complexcontent>                                                      <xs:extension base="servicetype">                     <xs:all>                         <xs:element name="templatecode" type="xs:string"/>                     </xs:all>                 </xs:extension>             </xs:complexcontent>         </xs:complextype>     </xs:element>     <xs:complextype name="servicetype">         <xs:all>             <xs:element name="servicecode" type="xs:string"/>         </xs:all>     </xs:complextype> </xs:schema> 

when try save in xmlspy tells me

an 'all' model group neither allowed in complex type definition 'mstns:servicetype' nor in extension '{anonymous}'.

clicking details gives link a paragraph in xml schema specification not understand.

added: ah, yes, forgot mention - line of error one:

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

the problem can't have if you're extending type. far xml knows parent type might have sequence model , since xml forbids putting group inside of sequence group (since destroy sequence group's ordering) xml forbids putting group in extension of complex type. use sequence instead of both though , you'd fine.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -