Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to handle special characters when uploading to Confluence with storage format?

Jacob Young August 5, 2015

I am creating a table in Java using the Confluence storage format and XML-RPC. My table looks like this:

<table><tbody>
<tr><th>Carrier</th><th>Number of Devices</th></tr>
<tr>
<td>Verizon</td>
<td>6 (3.59%)</td>
</tr>
<tr>
<td>Sprint</td>
<td>2 (1.19%)</td>
</tr>
<tr>
<td>AT&T</td>
<td>6 (3.59%)</td>
</tr>
</tbody></table>

I get the following error, which I am sure is because of the "&" symbol in "AT&T":

Exception in thread "main" org.apache.xmlrpc.XmlRpcException: java.lang.Exception: com.atlassian.confluence.rpc.RemoteException: [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '<' (code 60); expected a semi-colon after the reference for entity 'T'

How do I deal with this? I still want the "&" symbol to show up in my table in Confluence.

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Jacob Young August 5, 2015

Figured it out... Turns out that instead of just "&", you need "&amp;".

Atlassian, you should have a page somewhere that lists all of the additional "escape" characters needed for special characters such as this. Or just update your storage format so that it is automatically taken care of.

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 5, 2015

Hi @Jacob Young - our documentation is located @ https://confluence.atlassian.com/display/DOC/Confluence+Storage+Format The storage format is XHTML-based, so the APIs will only accept well-formed, valid XML as input. The list of XML reserved characters is available online. Here's a good reference from Wikipedia, for example - https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

Jacob Young August 5, 2015

Ah, thank you!

TAGS
AUG Leaders

Atlassian Community Events