[ http://issues.apache.org/jira/browse/XERCESC-1220?page=all ]
     
Alberto Massari resolved XERCESC-1220:
--------------------------------------

    Resolution: Invalid

Xerces allows "1" as a value for the "nillable" attribute in an XML Schema 
definition, because "nillable" is defined as a xs:boolean attribute.
But xsi:nil is used in an XML instance, and the specs define this attribute as:

"2.6.2 xsi:nil

XML Schema: Structures introduces a mechanism for signaling that an element 
should be accepted as valid when it has no content despite a content type which 
does not require or even necessarily allow empty content. An element may be 
valid without content if it has the attribute xsi:nil with the value true. "

So the only allowed value for xsi:nil is the string "true"

Alberto

> Unrecognized attribute value for xsi:nil='1'
> --------------------------------------------
>
>          Key: XERCESC-1220
>          URL: http://issues.apache.org/jira/browse/XERCESC-1220
>      Project: Xerces-C++
>         Type: Bug
>   Components: Validating Parser (Schema) (Xerces 1.5 or up only)
>     Versions: 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.5.0
>  Environment: All systems
>     Reporter: Matthias Jung
>     Priority: Minor
>  Attachments: patchfile.txt
>
> Within XML elements the xsi:nil attribute is only handled as logiacal true if 
> its value is 'true'. Otherwise it is set to its default value: false.
> XML Schema Spec also defines '1' to be a valid value to express logical true.
> Here a simple example 
> XML instance:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <ns:A xmlns:ns="xxx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>     <B xsi:nil="1"/>
> </ns:A>
> Schema definition:
> <xsd:schema targetNamespace="xxx" xmlns:tns="xxx" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>   <xsd:complexType name="B">
>     <xsd:sequence>
>        <xsd:element name="b1" type="xsd:string"/>
>     </xsd:sequence>
>   </xsd:complexType>
>   <xsd:complexType name="A">
>     <xsd:sequence>
>       <xsd:element name="B" type="tns:B" nillable="true"/>    
>     </xsd:sequence>
>   </xsd:complexType>
>   <xsd:element name="A" type="tns:A"/>
> </xsd:schema>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to