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

Generated namespace prefixes not properly used by some OMFactories

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.10
    • Fix Version/s: 1.2.13
    • Component/s: DOOM
    • Labels:
      None

      Description

      Given this code:
      OMDOMFactory factory = new OMDOMFactory();
      OMElement element = factory.createOMElement("name", "ns", null);

      I expected this output:
      <generatedNamespace:name xmlns:generatedNamespace="ns"/>

      This was the actual output:
      <name xmlns:generatedNamespace="ns" xmlns="ns"/>

      While the generated element is within the expected namespace, the output's use of a default namespace where none is necessary is a problem, particularly if you wish to use prefixed elements as frequently as possible. In fact, the generated prefix may never be used as long as the default is available.

      This problem can be ameliorated in two lines of counter-intuitive code:

      OMNamespace ns = element.findNamespace("ns", null);
      element.setNamespace(ns);

      After running those additional lines of code, the output will match the expectation, but that code is hard to justify.

      This bug was observed in: OMDOMFactory, DOMSOAPFactory, SOAP11Factory (dom), SOAP12Factory (dom).
      This bug does not occur in: OMLinkedListImplFactory, SOAP11Factory (llom), SOAP12Factory (llom).

        Attachments

          Activity

            People

            • Assignee:
              veithen Andreas Veithen
              Reporter:
              jgrahn James Grahn
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: