[
https://issues.apache.org/jira/browse/AXIS2C-1627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13621766#comment-13621766
]
Alex Mantaut edited comment on AXIS2C-1627 at 4/4/13 1:35 PM:
--------------------------------------------------------------
By looking at the xml standard it seems that indeed the parser should escape
ampersands both in attributes and values.
I looked into libxml and it escapes the '&'...
By looking at how it was done in the attributes I created a method to do this
for the attributes...
Attached patch takes care of that...
was (Author: alexmantaut):
By looking at the xml standard it seems that indeed the parser should
escape ampersands both in attributes and values.
By looking at how it was done in the attributes I created a method to do this
for the attributes...
Attached patch takes care of that...
> Serialization puts ampersands, etc. in attribute values, instead of entity
> references.
> --------------------------------------------------------------------------------------
>
> Key: AXIS2C-1627
> URL: https://issues.apache.org/jira/browse/AXIS2C-1627
> Project: Axis2-C
> Issue Type: Bug
> Components: guththila
> Affects Versions: 1.6.0
> Environment: Linux
> Reporter: Wes Munsil
> Priority: Blocker
> Attachments: axis2c-1627.patch, axis2c-1627.tar.gz
>
>
> 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]