Trying to get XML to work in WordPress
-
I’m trying to get some XML to work on my WordPress site. The XML is in a widget that I’ve made.
The code looks something like this:
$xml = new DOMDocument; $xml->load('./wp-content/plugins/Belimo/test.xml'); $xsl = new DOMDocument; $xsl->load('./wp-content/plugins/Belimo/style.xsl'); $proc = new XSLTProcessor; $proc->importStyleSheet($xsl); echo $proc->transformToXML($xml);
The problem seem to be $proc = new XSLTProcessor;, anything echoed behind it just wont work. If I were to write echo “Hi”; after it, it simply wouldn’t be echoed.
Something does happen to the page though, when I go to the page with the widget on it – the dashboard shortcuts at the top disappears and so does the page’s white background. Everything but logos, menus, links and text becomes gray like the sites background.
Anyone tried to do something similar? Perhaps you have an idea of what I’m doing wrong? I’d appreciate any reply. Thank you.
- The topic ‘Trying to get XML to work in WordPress’ is closed to new replies.