FYI: workaround for report xslt and the error "Name cannot begin with the ' ' character, hexadecimal value 0xA0. Line X, position X."

Tuesday, September 16, 2014
Avatar
When generating/executing a report, we frequently run into the error "Name cannot begin with the ' ' character, hexadecimal value 0xA0. Line X, position X."
As far as we can tell, this error is related to pasting text into the report's xslt "Template" field.  It seems that when you do a paste, if the text you are pasting begins or ends with a space, then code within the field's paste event replaces beginning and ending spaces with non-breaking space characters (0xA0).

The best workaround we have found is to not include a space at the beginning or end of text that you are copying to paste in the field.  This is not a solution because it is very common to copy-paste text within the xslt "Template" field that has either a leading or trailing space, e.g. while pasting html or xsl attributes from one element to another.

If you have encountered this error then it's difficult to resolve it because the offending character looks just like a normal space.  Here's an additional workaround for finding problematic non-breaking spaces after encountering the error:

  1. Open a separate browser tab to http://regexpal.com/
  2. Put the following text in the page's top box

    \xA0

  3. Copy-paste your text from your xlst Template field into the page's second box.
  4. The non-breaking spaces should now be highlighted.  (Highlighting alternates between yellow and blue for each match.)
  5. You can ignore non-breaking spaces that appear at the beginning of lines.  They don't need to be changed or replaced.  They won't break the report.  
  6. Replace the non-breaking spaces that aren't at the beginning of lines with normal spaces (within the xlst Template field).
1 Replies
Thursday, September 18, 2014
Avatar
re: jfreed Tuesday, September 16, 2014
Thanks for the information, Jon!

Regards,
Elise

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Tuesday, September 16, 2014
  • Last Reply: Thursday, September 18, 2014
  • Replies: 1
  • Views: 14612