IBM Support

PM30371: THE ATTRIBUTE CREATED FOR A DEFAULT NAMESPACE DECLARATION USING XMLSTREAMWRITER IS SOMETIMES NAMED "XMLNS:"

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When using an XMLStreamWriter, the attribute
    created for a default namespace declaration is sometimes named
    "xmlns:". The ":" should not be present after the "xmlns".
    
    This can be reproduced with the following code snippet.
    
    import javax.xml.stream.XMLOutputFactory;
    import javax.xml.stream.XMLStreamWriter;
    
    public class TestStreamWriter {
    public static final void main(String[] args) throws
    Exception {
    XMLOutputFactory xof = XMLOutputFactory.newInstance();
    XMLStreamWriter writer =
    xof.createXMLStreamWriter(System.out);
    
    writer.writeStartDocument();
    writer.writeStartElement(new String(""), "root",
    "http://ibm.com/abc/example");
    writer.writeNamespace(new String(""),
    "http://ibm.com/abc/example");
    writer.writeEndElement();
    writer.writeEndDocument();
    }
    }
    
    The output of this test is:
    
    <?xml version="1.0" encoding="UTF-8"?><root
    xmlns:="http://ibm.com/abc/example"></root>
    
    but the expected output is:
    
    <?xml version="1.0" encoding="UTF-8"?><root
    xmlns="http://ibm.com/abc/example"></root>
    

Local fix

  • n/a
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All IBM WebSphere Application Server V7.0   *
    *                  users of StAX.                              *
    ****************************************************************
    * PROBLEM DESCRIPTION: The default namespace declaration is    *
    *                      sometimes written as "xmlns:" by an     *
    *                      XMLStreamWriter.                        *
    ****************************************************************
    * RECOMMENDATION:  Install a fix pack that contains this APAR. *
    ****************************************************************
    When using an XMLStreamWriter to serialize an XML document a
    namespace declaration for the default namespace may be written
    as xmlns:="nsURI", resulting in a malformed XML document.
    

Problem conclusion

  • The XMLStreamWriter implementation was expecting a specific
    instance of the empty string for the prefix of the default
    namespace. It would write a spurious colon as part of the
    attribute name if it received a different instance of the
    empty string. The problem was resolved by fixing the equality
    check for the default namespace.
    
    The fix for this APAR is currently targeted for inclusion in
    fix pack 7.0.0.17.  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

    PM30371

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    700

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-01-12

  • Closed date

    2011-01-27

  • Last modified date

    2011-02-04

  • 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

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R700 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
27 October 2021