Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

How do you stop .ss template from stripping out xml header?


Reply

2 Posts   676 Views

Avatar
fostahgix

12 May 2010 at 9:06am (Last edited: 12 May 2010 9:06am), Community Member, 9 Posts

Hello everyone,

I have had this issue before and resolved it by disabling the content negotiator which is now deprecated. Does anyone know how to stop ssviewer.php from stripping out my xml header?

XmlPage.ss

<?xml version="1.0" encoding="UTF-8"?>
<gallery>
<album title="Title" description="Description" lgpath="">
<img src="{$FLVideo.Link}" />
</album>
</gallery>

Output in firefox:

<gallery>
<album title="Title" description="Description" lgpath="">
<img src="{$FLVideo.Link}" />
</album>
</gallery>

The Issue is its stripping out the xml header so it leaves a whitespace in the spot the header is supposed to be.

What is the proper way to keep this header in my template?

Thanks!

Avatar
fostahgix

12 May 2010 at 9:32am Community Member, 9 Posts

So I have just removed the header completely and everything works fine now that the first element in my xml document starts on line 1 instead of line 2. I'm not sure if this is an issue or not but this resolved it.