When I come across a broken RSS feed, the usual reason its all blown to pieces is because line 23 says "Sanford & Sons."
The most confusing thing is the fact that if you convert the &
into &
, all is well, even though your alternative still contains the problem character.
Why does RSS fail at rendering the ampersand (&
) character by default?
When a 'raw' &
is seen, the interpreter is looking for one of the valid escaped & sequences (such as '&'
). When an invalid sequence is found it throws an error. That's all there is to it.
Because rss is an XML-based format and in xml the ampersand (&) signifies the start of an xml entity. The parser is expecting something else there.
You could argue that it should be smart enough to know that the ampersand in "Sanford & Sons"
is just an ampersand. But what about when you really want to show ampersand with text? Is "&pc;
some custom (also invalid) entity, or should it interpret that as an ampersand also? What about "&"
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With