I’ve just installed Obsidian on a Windows 10 machine and pasted some XML into the welcome page which appears as formatted text in edit mode. Nice. However, in reader mode the XML does not appear and nor does it appear in an exported PDF.
I’ve tried the Ctrl-Shift-V I read in the forums but that didn’t work either.
Now, it may be me, as I’m not familiar with Markdown.
Here’s the XML I’m attempting to paste:
<?xml version='1.0' encoding='utf-8' ?>
Any suggestions?
Guapa
March 4, 2025, 2:10pm
2
You want to see the line without it being parsed, yes? Can block it either inline or as chunk of text:
`<?xml version='1.0' encoding='utf-8' ?>`
OR
```
<?xml version='1.0' encoding='utf-8' ?>
```
I’ve tried the code block but it loses the formatting. I’d much prefer the formatted version as I’m attempting to document an XML based system.
Guapa
March 4, 2025, 2:18pm
4
Do you get what you want if you add the language code to the block (as detailed on the help page linked above)?
```XML
<?xml version="1.0" encoding="UTF-8"?>
<shiporder orderid="889923"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="shiporder.xsd">
<orderperson>John Smith</orderperson>
<shipto>
<name>Ola Nordmann</name>
<address>Langgt 23</address>
<city>4000 Stavanger</city>
<country>Norway</country>
</shipto>
<item>
<title>Empire Burlesque</title>
<note>Special Edition</note>
<quantity>1</quantity>
<price>10.90</price>
</item>
<item>
<title>Hide your heart</title>
<quantity>1</quantity>
<price>9.90</price>
</item>
</shiporder>
```