APAR status
Closed as program error.
Error description
For each serialization call (ie: XMLHelper.save()), an extra namespace prefix gets appended into the serialized output: **************************************************************** <?xml version="1.0" encoding="UTF-8"?> <Foo xmlns:ns0="http://TestDuplicateNamespace" xmlns="http://TestDuplicateNamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns0:Foo"> <prop>test</prop> </Foo> <?xml version="1.0" encoding="UTF-8"?> <Foo xmlns:ns0="http://TestDuplicateNamespace" xmlns:ns1="http://TestDuplicateNamespace" xmlns="http://TestDuplicateNamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:Foo"> <prop>test</prop> </Foo> <?xml version="1.0" encoding="UTF-8"?> <Foo xmlns:ns0="http://TestDuplicateNamespace" xmlns:ns1="http://TestDuplicateNamespace" xmlns:ns2="http://TestDuplicateNamespace" xmlns="http://TestDuplicateNamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:Foo"> <prop>test</prop> </Foo> **************************************************************** L2 has provided the following code, which demonstrates the extra namespace prefix that gets appended into the serialized output for each serialization call: - The pure XCI/SDO code: Map<String, Object> helperContextOptions = new HashMap<String, Object>(); helperContextOptions.put(SDOUtil.OPTION_BO_COMPATIBLE, true); HelperContext hc = SDOUtil.createHelperContext(helperContextOptions); TypeHelper typeHelper = hc.getTypeHelper(); DataFactory factory = hc.getDataFactory(); XMLHelper xmlHelper = hc.getXMLHelper(); URL url = new File("src/Schema/TestDuplicateNamespace.xsd").toURI().toURL(); hc.getXSDHelper().define(url.openStream(), url.toExternalForm()); Type type = typeHelper.getType("http://TestDuplicateNamespace", "Foo"); DataObject foo = factory.create(type); foo.set("prop", "test"); Map inOptions = new HashMap(); commonj.sdo.helper.XMLDocument docResult = new XMLDocumentImplExt(hc, foo, "http://TestDuplicateNamespace", "Foo"); inOptions.put(SDOUtil.OPTION_FAST_SERIALIZATION, true); inOptions.put(SDOUtil.OPTION_SAVE_INDENT, true); xmlHelper.save(docResult, System.out, inOptions); System.out.println(); System.out.println(); xmlHelper.save(docResult, System.out, inOptions); - The result with the second one containing the duplicate namespace prefix. <?xml version="1.0" encoding="UTF-8"?> <Foo xmlns:ns0="http://TestDuplicateNamespace" xmlns="http://TestDuplicateNamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns0:Foo"> <prop>test</prop> </Foo> <?xml version="1.0" encoding="UTF-8"?> <Foo xmlns:ns0="http://TestDuplicateNamespace" xmlns:ns1="http://TestDuplicateNamespace" xmlns="http://TestDuplicateNamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:Foo"> <prop>test</prop> </Foo> ====
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: All IBM WebSphere Application Server * * Feature * * Pack for XML users * **************************************************************** * PROBLEM DESCRIPTION: For each call to serialize in * * SDO/X, an extra namespace * * prefix gets appended into the * * serialized output. * **************************************************************** * RECOMMENDATION: * **************************************************************** During each serialization call, SDO/X has no recollection of previously generated namespace prefixes from previous serialization calls. As a result, it redundantly generates new namespace prefixes and appends it to the serialized output for each new request to serialize.
Problem conclusion
The algorithm in the XCI layer of SDO/X has now been updated to include a check for previously generated prefixes from previous serialization requests. As a result, the code will no longer append redundant namespace prefixes. The fix for this APAR is currently targeted for inclusion in XML Feature Pack 1.0.0.15. Please refer to the Recommended Updates page for delivery information: http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
Temporary fix
Comments
APAR Information
APAR number
PM89169
Reported component name
XML FEATUREPACK
Reported component ID
5724J0856
Reported release
700
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-05-16
Closed date
2013-06-26
Last modified date
2013-10-01
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XML FEATUREPACK
Fixed component ID
5724J0856
Applicable component levels
R700 PSY
UP
[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SUPPORT","label":"IBM Worldwide Support"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0","Edition":"","Line of Business":{"code":"","label":""}}]
Document Information
Modified date:
09 February 2022