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

This widget could not be displayed.
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 Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Tuesday in Confluence

Add-on evaluation with confluence templates

Atlassian market place contains number of Apps/Addons which improves the capability of out of the box Atlassian products. It is good to follow a plugin evaluation process before install add-ons. So t...

170 views 12 7
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