Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337932

Summary: xsd validation issue with base type of boolean not correctly validated when 0 or 1 are used.
Product: [WebTools] WTP Source Editing Reporter: Peter Lenahan <Peter_Lenahan>
Component: wst.xsdAssignee: wst.xsd-triaged <wst.xsd-triaged>
Status: RESOLVED NOT_ECLIPSE QA Contact: Keith Chong <keith.chong.ca>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Peter Lenahan CLA 2011-02-22 23:30:38 EST
The code snippet correctly validates on the w3c site.

The w3c standard defines a boolean to allow 4 values,  true, false, 0, and 1
The eclipse xld validator fails when 0 and 1 are defined in the case below.

http://www.w3.org/TR/xmlschema-2/#boolean

3.2.2 boolean

[Definition:]  boolean has the ·value space· required to support the mathematical concept of binary-valued logic: {true, false}.

3.2.2.1 Lexical representation

An instance of a datatype that is defined as ·boolean· can have the following legal literals {true, false, 1, 0}.



The Eclipse Validator fails then the values of 0 and 1 are used, but passes when true and false are used.


<xs:attribute name="root" default="1" >
   <xs:annotation>
     <xs:documentation>
	   'root' can be used to distinguish serialization roots from 
       other elements that are present in a serialization but are 
       not roots of a serialized value graph 
	 </xs:documentation>
   </xs:annotation>
   <xs:simpleType>
     <xs:restriction base='xs:boolean'>
	   <xs:pattern value="0|1" />
	 </xs:restriction>
   </xs:simpleType>
 </xs:attribute>







-- Configuration Details --
Product: Eclipse 1.3.0.20100617-0521 (org.eclipse.epp.package.jee.product)
Installed Features:
 org.eclipse.wst.xml_ui.feature 3.2.0.v201005241510-7H7AFUIDxumQGOb7ocjUR2Pvz-28
Comment 1 Keith Chong CLA 2011-03-02 23:43:09 EST
This error comes from Xerces which is used by the WTP XML Schema
validator. You can pursue this issue further at Apache, perhaps starting with a
bug report here http://xerces.apache.org/xerces2-j/jira.html.
Comment 2 Peter Lenahan CLA 2011-03-03 00:01:39 EST
I opened up the issue with Apache.

https://issues.apache.org/jira/browse/XERCESJ-1497

Thanks,
Peter