2

Here's a link to my RSS feed's failed validation. Nevermind the subtitles being too long, I'll fix that later. But fixing these special characters is a pill and in company names where it's part of their brand fixture, I can't readily change "&" to "and". How can I escape these characters? In the channel entry, the channel field type is sometimes Wyvern (already escaped the HTML character) and sometimes simply Text Input, which I believe is plain text right?

  • could you please post your template? – Jeremy Gimbel Oct 8 '13 at 13:19
4

unexplainedBacn is right.

Or you can also use the XML Encode plugin for this. It's actually included with ExpressionEngine

This plugin converts reserved XML characters to entities. It is used in the RSS templates.

To use this plugin, wrap anything you want to be processed by it between these tag pairs:

{exp:xml_encode}
    text you want processed
{/exp:xml_encode}

To see more on usage go to Add-ons > Plugins > XML Encode in your EE Control Panel.

| improve this answer | |
1

As a workaround, you could wrap the offending content in <![CDATA[{content}]]> tags.

Like so:

<description>
<![CDATA[
{body}
]]>
</description>

This won't actually escape the characters, but it will tell the validator to not worry about it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.