Illegal XML Character Error When Viewing a Page in Confluence 4.0

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

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

1 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:

1 

Resolution

  1. Run this query in your Confluence database:

    1 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:

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

    For example:

    1 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.

Updated on April 16, 2025

Still need help?

The Atlassian Community is here for you.