W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

XSV - Another possible bug with XSV type checking

From: Tom Preston <tpreston@amadeusboston.com>
Date: Mon, 3 Dec 2001 12:39:07 -0500
Message-ID: <498B0C8F9141D511927B009027B11387368396@email-temp.vacation-corp.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Cc: ht@cogsci.ed.ac.uk
boolean types don't seem to be checked with XSV validation.  See allowNull
element which is declared boolean and see that the value that I have given
in the instance document is "adfsa".  I think that the only valid boolean
values are supposed to be true, false, 1, 0.  

"strict" XSV validation says that this .xml file is "valid":
-----------------------------
<htmlEditor
   xmlns="http://www.emilygraham.com/java/other/editor.xsd">
   
  <updateTime></updateTime>
  <fields>
    <field columnName="nickname">
      <shortDesc>Short Desc</shortDesc>
      <htmlType name="select">
        <name>firstName</name>
        <value>lastName</value>
      </htmlType>
      <allowNull>adfsa</allowNull>      
      <defaultVal>Blueberry</defaultVal>
    </field>
  </fields>   
</htmlEditor>
-----------------------------
AGAINST this .xsd file:
-----------------------------
<schema targetNamespace="http://www.emilygraham.com/java/other/editor.xsd"
        xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:e="http://www.emilygraham.com/java/other/editor.xsd"
        elementFormDefault="qualified">        

  <annotation>
    <documentation xml:lang="en">
     Editor document definition defines an html based editor
    </documentation>
  </annotation>

  <element name="htmlEditor" type="e:HtmlEditorType"/>

  <element name="updateTime" type="dateTime"/>

  <complexType name="HtmlEditorType">
    <sequence>
      <element ref="e:updateTime" minOccurs="1" maxOccurs="1" />
      <element name="fields" type="e:Fields" minOccurs="1" maxOccurs="1" />
    </sequence>
  </complexType>

  <complexType name="Fields">
    <sequence>
      <element name="field" minOccurs="1" maxOccurs="unbounded">
        <complexType>
          <sequence>
            <element name="shortDesc" type="string" minOccurs="1"
maxOccurs="1"/>
            <element name="htmlType" type="e:HtmlTypeType" minOccurs="1"
maxOccurs="1"/>
            <element name="allowNull" type="boolean" minOccurs="1"
maxOccurs="1" />
            <element name="defaultVal"  type="string"/>
          </sequence>
          <attribute name="columnName" type="string" use="required"/>
        </complexType>
      </element>
    </sequence>
  </complexType>

  <complexType name="HtmlTypeType">
    <sequence> 
      <element name="name" type="string" /> 
      <element name="value" type="string" /> 
    </sequence>  
    <attribute name="name" type="e:HtmlNameType" use="required"/>  
  </complexType>
 
  <simpleType name="HtmlNameType">
    <restriction base="NMTOKEN">   
      <enumeration value="select"/>
      <enumeration value="text"/>
    </restriction>   
  </simpleType>
</schema>
-----------------------------
Received on Monday, 3 December 2001 12:39:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:25 GMT