Hi Matthias,

That sure sounds like a bug.  You might want to put your test case (and a
patch if you have it!) into a Jira bug report.

Note that fixing SGXMLScanner will only work if you instruct the parser
you're using to use that scanner; by default, the parser uses IGXMLScanner,
since that scanner also knows how to deal with DTD's.  So one needs to fix
problems like this in both places in order to have fixed them completely.

Cheers,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  [EMAIL PROTECTED]




                                                                                       
                                                
                      Matthias Jung                                                    
                                                
                      <[EMAIL PROTECTED]        To:       [EMAIL PROTECTED]            
                                       
                      radyne.com>              cc:                                     
                                                
                                               Subject:  xsi:nil="1" problem           
                                                
                      05/27/2004 11:18                                                 
                                                
                      AM                                                               
                                                
                      Please respond to                                                
                                                
                      xerces-c-dev                                                     
                                                
                                                                                       
                                                
                                                                                       
                                                



Hi all,

while performing XML Schama validation with SOAP messages created by
Axis, I ran into a problem validating complex type elements containing
the attibute 'xsi:nil="1"'. Even defined as nillable in the schema
definition the validator created an error indicating the element would
not be valid for its content model.

Changing the nil attribute to 'xsi:nil="true"' everything works fine.

XML Schema specification defines the nil attribute of type boolean that
allows '1' as a valid boolean value.

Having a first look in the sources I discovered
SGXMLScanner::scanRawAttrListforNameSpaces(int attCount) only checking
for 'true' but not for '1'.

So my questions:
Is the value '1' for nil attributes not supported by xerces?
If so, is there a special reason, or am I misinterpreting XML Schema Spec?
A quick fix in SGXMLScanner did not affect the wrong behaviour. So is
this part of code the correct place to look for? Maybe Ihave to look
some deeper into the sources and do some printf-debugging


Thanks for clarification and help

Matthias


P.S. This problem occurs with xerces version 2.1 - 2.5

<?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><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:element name="b2" type="xsd:string"/>
                               <xsd:element name="b3" 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>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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

Reply via email to