Re: XSD simpleType with final = extension

Michael Kay <[email protected]>
Newsgroups gmane.text.xml.devel
Message-ID <[email protected]>
Following the paper trail on this leads to

https://www.w3.org/Bugs/Public/show_bug.cgi?id=5783

which is a bug against XSD 1.0 that was never resolved. So I think the answer to your question is that it's a known bug in the spec.

In most cases, but perhaps not all, when there's a known bug in XSD 1.0, consulting XSD 1.1 will give you the preferred resolution.

Michael Kay
Saxonica

> On 6 Mar 2022, at 12:47, Mukul Gandhi <[email protected]> wrote:
> 
> Hi all,
>    I shall cite following references, from XML Schema specifications.
> 
> XSD 1.1 structures spec,
> 
> 3.16.2 XML Representation of Simple Type Definition Schema Components
> 
> <simpleType
>   final = (#all | List of (list | union | restriction | extension))
>  .....
> 
> XSD 1.0 structures spec,
> 
> 3.14.2 (non-normative) XML Representation of Simple Type Definition Schema Components
> 
> <simpleType
>   final = (#all | List of (list | union | restriction))
>  .....
> 
> As you can see that, XSD 1.1 specifies "extension" as a possible value of "final" attribute of simpleType. Is "extension" a valid value of simpleType's attribute "final"? If yes, what is its semantics?
> 
> XSD 1.0 doesn't specify "extension" as a possible value of "final" attribute of simpleType.
> 
> But there's a following microsoft test case XSD document within W3C XSD 1.0 test suite (which specifies "extension" as a value of simpleType's attribute "final"),
> 
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema <http://www.w3.org/2001/XMLSchema>">
> 
>      <xs:simpleType name="myType" final="extension">
>           <xs:restriction base="xs:string" />
>      </xs:simpleType>
> 
>      <xs:complexType name="ct">
>           <xs:simpleContent>
>               <xs:extension base="myType">
>                    <xs:anyAttribute />
>               </xs:extension>
>            </xs:simpleContent>
>      </xs:complexType>
> 
>      <xs:element name="myElement" type="ct" />
> 
> </xs:schema>
> 
> The corresponding test case definition, within W3C XSD 1.0 test suite is following,
> 
> <schemaTest name="stZ041">
>     <schemaDocument xlink:href="../msData/simpleType/stZ041.xsd"/>
>     <expected validity="valid"/>
>     <current date="2006-12-22" status="queried" bugzilla="http://www.w3.org/Bugs/Public/show_bug.cgi?id=4064 <http://www.w3.org/Bugs/Public/show_bug.cgi?id=4064>"/>
>     <prior date="2006-07-16" status="accepted"/>
> </schemaTest>
> 
> Is the above cited test case correct?
> 
> Any thoughts about above mentioned points, shall be helpful to know.
> 
> PS: to my enlightenment, the related w3c bugzilla entry for this test case cited above concludes, "WG agreed that either way the test is invalid".
> 
> 
> -- 
> Regards,
> Mukul Gandhi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.