Uploaded image for project: 'Axiom'
  1. Axiom
  2. AXIOM-398

Return value of OMNamedInformationItem#getNamespace() should be normalized

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.2.12
    • 1.2.13
    • API
    • None

    Description

      For elements and attributes without namespace, getNamespace() may return two different values: null or an OMNamespace instance that has both prefix and namespaceURI properties set to the empty string. The value that is actually returned in this case depends in subtle ways on how the information item was created. This can be illustrated by the following code snippet:

      OMElement element1 = AXIOMUtil.stringToOM("<root/>");
      System.out.println(element1.getNamespace());
      OMElement element2 = AXIOMUtil.stringToOM("<root xmlns=''/>");
      System.out.println(element2.getNamespace());

      The output is:

      null
      org.apache.axiom.om.impl.common.OMNamespaceImpl@0

      One can see that although the two elements are equivalent, the return value of getNamespace() is different.

      The return value of getNamespace() should be normalized such that it is always the same (i.e. null) for information items without namespace.

      Attachments

        Activity

          People

            veithen Andreas Veithen
            veithen Andreas Veithen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: