
|
If you were logged in you would be able to see more operations.
|
|
|
| Resolution Date: |
02/Feb/05 02:10 AM
|
|
When a simple type is serialized as an element, and is nil, the namespace prefix is omitted from the opening XML tag.
Using an extract from the ComplexTypeAll test, which highlighted this issue:
The text element field1 should be represented as:
<ns1:field1 xsi:nil="true"></ns1:field1>
But is actually being represented as:
<field1 xsi:nil="true"></ns1:field1>
Currently, in BasicTypeSerializer::serializeAsElement()for XSD_STRING, XSD_ANYURI, XSD_QNAME and XSD_NOTATION there is a check for a NULL value, into this the lines marked + in the following need to be inserted:
pStr = *((char**)(pValue));
if (!pStr)
{
/*
* It is a null value not an empty value.
*/
m_sSZ = "<";
+ if (NULL != pPrefix)
+ {
+ m_sSZ += pPrefix;
+ m_sSZ += ":";
+ }
m_sSZ += pName;
m_sSZ += " xsi:nil=\"true\">";
}
|
|
Description
|
When a simple type is serialized as an element, and is nil, the namespace prefix is omitted from the opening XML tag.
Using an extract from the ComplexTypeAll test, which highlighted this issue:
The text element field1 should be represented as:
<ns1:field1 xsi:nil="true"></ns1:field1>
But is actually being represented as:
<field1 xsi:nil="true"></ns1:field1>
Currently, in BasicTypeSerializer::serializeAsElement()for XSD_STRING, XSD_ANYURI, XSD_QNAME and XSD_NOTATION there is a check for a NULL value, into this the lines marked + in the following need to be inserted:
pStr = *((char**)(pValue));
if (!pStr)
{
/*
* It is a null value not an empty value.
*/
m_sSZ = "<";
+ if (NULL != pPrefix)
+ {
+ m_sSZ += pPrefix;
+ m_sSZ += ":";
+ }
m_sSZ += pName;
m_sSZ += " xsi:nil=\"true\">";
}
|
Show » |
|
Have also introduced a new test NilValuesTest to detect any future regressions in this area.