Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1627

Serialization puts ampersands, etc. in attribute values, instead of entity references.

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.7.0
    • Component/s: guththila
    • Labels:
      None
    • Environment:
      Linux

      Description

      Serialization puts ampersands, etc. in attribute values, instead of entity references. This causes XML that is not well-formed to be returned to the client.

      The result of this code

      axiom_namespace_t * ns = axiom_namespace_create(env, "namespace", "ns");

      axiom_node_t * node;
      axiom_element_t * element = axiom_element_create(env, NULL, "el", ns, &node);

      axiom_element_set_text(element, env, "T1 & T2", node);
      axiom_element_add_attribute(element, env, axiom_attribute_create(env, "name", "A1 & A2", NULL), node);

      axis2_char_t * xml = axiom_node_to_string(node, env);

      AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "XML is %s", xml);
      AXIS2_FREE(env->allocator, xml);

      is this:

      XML is <ns:el xmlns:ns="namespace" name="A1 & A2">T1 & T2</ns:el>

      Note that the & in the element body is correctly represented, but the & in the attribute value is not.

        Attachments

        1. axis2c-1627.tar.gz
          1 kB
          Alex Mantaut
        2. axis2c-1627.patch
          5 kB
          Alex Mantaut

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              whitemarlin Wes Munsil

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment