XML Parsing Error in response due to invalid character in attribute
--------------------------------------------------------------------
Key: RF-10277
URL:
https://issues.jboss.org/browse/RF-10277
Project: RichFaces
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 3.3.3.Final
Environment: richfaces 3.3.3
myfaces 1.2.9
facelets
neko parser 1.9.12
Reporter: Michael Heinen
An ajax response is not updated on clientside if it contains ISO control characters like
'START OF HEADING' (in windows Alt + 01 or U+0001) in attributes of tags.
(see
http://www.fileformat.info/info/unicode/char/1/index.htm)
The ajax console shows during rendering:
error[14:57:16,523]: Error parsing XML
error[14:57:16,523]: Parse Error: XML Parsing Error: Invalid unicode character.
The parser error occurs in combination with neko filter if such a special character is
used as an attribute value, e.g. as value of an inputText field.
This is caused by a wrong transformation in class
org.ajax4jsf.xml.serializer.ToXHTMLStream.
Method ToXHTMLStream.writeAttrString contains following check:
String outputStringForChar = m_charInfo.getOutputStringForChar(ch);
if (null != outputStringForChar)
{
writer.write(outputStringForChar);
}
else if (escapingNotNeeded(ch))
{
writer.write(ch); // no escaping in this case
}
else
{
writer.write("&#");
writer.write(Integer.toString(ch)); //THIS IS CALLED!
writer.write(';');
}
The 'START OF HEADING' control char is transformed to the entity  which
results in an parsing error on client side.
The char is correctly processed and displayed in NON-Ajax requests.
The char is correctly processed and displayed in Ajax requests in outputfields (as
\u0001).
The char is correctly processed but not displayed in the response if tidy filter is used
for ajax requests.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira