XMLHelperImpl::createDocument() gives invalid XML when the element has 
xsi:nil=true
-----------------------------------------------------------------------------------

                 Key: TUSCANY-705
                 URL: http://issues.apache.org/jira/browse/TUSCANY-705
             Project: Tuscany
          Issue Type: Bug
          Components: C++ SDO
    Affects Versions: Cpp-current
         Environment: WinXP
            Reporter: Caroline Maynard
            Priority: Critical
         Attachments: bug8506.patch

See http://pecl.php.net/bugs/bug.php?id=8506 for the test example. 
The schema is:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
  targetNamespace="http://ConvertedStockQuote";>
  <xs:element name="getQuote">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="ticker" type="xs:string" nillable="true"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

When the ticker element's value is not nil, the output is:
<?xml version="1.0" encoding="UTF-8"?>
<getQuote xmlns="http://ConvertedStockQuote"; xsi:type="getQuote" 
xmlns:tns="http://ConvertedStockQuote"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <ticker>IBM</ticker>
</getQuote>

but when it is nil, my user gets:
<?xml version="1.0" encoding="UTF-8"?>
<getQuote xmlns="http://ConvertedStockQuote"; xsi:type="getQuote" 
xmlns:tns="http://ConvertedStockQuote"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <getQuote xmlns="http://ConvertedStockQuote"; xsi:nil="true"/>
</getQuote>

I've attached a proposed patch. I removed the namespace URI to be consistent 
with the non-nil case, apologies if this is incorrect.


-- 
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