[ 
https://issues.apache.org/jira/browse/WSCOMMONS-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Veithen resolved WSCOMMONS-285.
---------------------------------------

    Resolution: Invalid

According to section 2.4 (Character Data and Markup) of "Extensible Markup 
Language (XML) 1.0 (Fourth Edition)":

<< The ampersand character (&) and the left angle bracket (<) must not appear 
in their literal form, except when used as markup delimiters, or within a 
comment, a processing instruction, or a CDATA section. If they are needed 
elsewhere, they must be escaped using either numeric character references or 
the strings "&amp;" and "&lt;" respectively. The right angle bracket (>) may be 
represented using the string "&gt;", and must, for compatibility, be escaped 
using either "&gt;" or a character reference when it appears in the string 
"]]>" in content, when that string is not marking the end of a CDATA section. >>

This clearly shows that Axiom's behavior is entirely correct. It should also be 
noted that it is not Axiom that handles the encoding of character data, but the 
underlying StAX implementation (through an XMLStreamWriter).

> AXIOM is not correctly encoding all XML special characters when inserted into 
> a String (">" not changed to "&gt;" when preceeded by "<")
> ----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-285
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-285
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>         Environment: Websphere 6.0/Rational Application Developer/Axis2
>            Reporter: Wally Dennis
>            Priority: Minor
>
> I need to pass a string containing XML through a web service, preferably 
> using Axis2.  When I set the outbound parameter with the string:
> <INPUT><SIGN-ON>JohnDoe</SIGN-ON><DATA>12345</DATA></INPUT>
> I should get  
> &lt;INPUT&gt;&lt;SIGN-ON&gt;JohnDoe&lt;/SIGN-ON&gt;&lt;DATA&gt;12345&lt;/DATA&gt;&lt;/INPUT&gt;
>   
> Instead, I get 
> &lt;INPUT>&lt;SIGN-ON>JohnDoe&lt;/SIGN-ON>&lt;DATA>12345&lt;/DATA>&lt;/INPUT>
> It appears to me that Axiom is not correctly changing the > to a &gt; when it 
> is preceeded by a <.  This exact same operation works in Axis.  We are hoping 
> to upgrade from Axis to Axis2, but since most of our web service calls 
> involve passing XML strings, we want to get this resolved.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to