Code Block Macro not works with XML format Edited

"code block" macro works fine for C# and SQL and more.

But when i use it for XML it display me empty content.

I tried with and without the next header:
<?xml version="1.0" encoding="UTF-8"?>

1 answer

Which version of Confluence are you using (Server/Cloud, if Server, which version number)?

In general, the Code Block macro works for XML, but it might have something to do with your particular version of Confluence and/or what kind of XML you are trying to display.


 i tried many simple XML.

Please try it to verify it is works now in the Cloud version.

Have you switched to the new interface?

I tested it in the old interface, and it worked fine.

I tested it in the new interface, and it didn't work to paste the XML code (the tags got stripped out), but typing the XML code directly worked ok.

Another option might be to install the Better Code Macro (free from Atlassian Labs), and that might work better for you.

How can i know if i used the old or new interface?

I am new user 2 weeks ago.

(my tags also got stripped out).


I will use the Better Code Macro.



If you are a new user, then you're probably on the new interface. It's the one with bright blue instead of dark blue, and with the main menu on the left side instead of the top.

I figured out a workaround to get past the XML pasting issue:

Put the cursor where you want the code macro to go, then click "➕ ", and "Markup".

In the box that pops up, make sure Confluence Wiki is selected, then type {code}, paste your XML, and then type {code} again.

Click the "Insert" button, and then you should have the code macro with the code inserted properly, and you can edit the options to choose "HTML and XML" to highlight the content properly.


Yes. i with the new interfcae.

Great workaround. Works fine.

If you will fix the problem it will be excellent.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

473 views 3 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you