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

0 vote
Stephen Deutsch Community Champion Jul 25, 2017

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.

Cloud.

 i tried many simple XML.

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

Stephen Deutsch Community Champion Jul 25, 2017

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.

 

Thanks

Stephen Deutsch Community Champion Jul 25, 2017

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.

Hi

Yes. i with the new interfcae.

Great workaround. Works fine.
Thanks.

If you will fix the problem it will be excellent.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

264 views 11 10
Join discussion

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