Illegal XML Character Error When Viewing a Page in Confluence 4.0

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When viewing a page in Confluence 4.0, instead of rendering the page's content, this error occurs:

Error: The XML content could not be parsed. There is a problem at line 2, column 94. Parser message: Illegal character entity: expansion character (code 0xb) not a valid XML character at [row,col {unknown-source}]: [2,94]

Cause

There are some invalid characters in the page that are not supported by XML. A simple example would be this character:



Resolution

  1. Run this query in your Confluence database:

    SELECT * FROM BODYCONTENT WHERE CONTENTID = (SELECT CONTENTID FROM CONTENT WHERE TITLE = '<title of page>' AND PREVVER IS NULL);

    Replace <title of page> with the title of the affected page.


  2. Keep note of the bodycontentid, which will come in handy in the search and replace query. Analyze the body field output to identify the character that is causing the issue.

  3. Remove the offending character via your database UI tool or by running a search and replace query. Example of a search and replace query in MySQL:

    update BODYCONTENT set BODY = replace(BODY,'[offending character]','');

    For example:

    update BODYCONTENT set BODY = replace(BODY,'&#xb;','');

    Always remember to backup your database prior to the update command, in case a rollback is necessary.

Other Cause

There's another cause of this issue, which is that Confluence wasn't upgraded successfully. If that's the case, try to upgrade Confluence again, and make sure that the build number in confluence.cfg.xml matches the latest entry in CONFVERSION table in Confluence's database.

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.