Bug in Saxon - it accepts as valid an element with a content model that is an empty choice

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in Saxon - it accepts as valid an element with a content model that is an empty choice

Costello, Roger L.

Hi Michael,

 

Per the discussion on the xml-dev list:

 

Consider this XML Schema, it declares an element with a content model that is a complex type that is an empty choice:
    
    
<xs:element name="Test3">
       
<xs:complexType>
           
<xs:choice/>
       
</xs:complexType>
   
</xs:element>

 

I created an XML instance document containing <Test3>:


   
<Test3></Test3>

 

and validated it against the schema. It validated, which you stated is not correct.

 

/Roger


------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Bug in Saxon - it accepts as valid an element with a content model that is an empty choice

Michael Kay
Thanks, I’ve already logged this here


and I’m in the middle of investigating it.

I’ve traced the problem to a bug in the spec, where it defines an empty choice as being “emptiable”; Saxon concludes that if it is “emptiable” then the empty sequence is a valid instance.

Michael Kay
Saxonica


On 2 Jun 2015, at 15:11, Costello, Roger L. <[hidden email]> wrote:

Hi Michael,

 

Per the discussion on the xml-dev list:

 

Consider this XML Schema, it declares an element with a content model that is a complex type that is an empty choice:
    
    
<xs:element name="Test3">
       
<xs:complexType>
           
<xs:choice/>
       
</xs:complexType>
   
</xs:element>

 

I created an XML instance document containing <Test3>:


   
<Test3></Test3>

 

and validated it against the schema. It validated, which you stated is not correct.

 

/Roger

------------------------------------------------------------------------------
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help