[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [syndication] Why is this rss feed invalid?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
"Alis Marsden" <alis@contentrelations.com> writes:
> >The discussed rss feed is :
> >http://www.trendsportworld.com/newsfeed/rssfeeduk.asp
>
> >error :
>
> >"Sorry, your RSS source did not validate. Here's the error message,
> >it may be cryptic. "Can't create item "." because "" is an illegal
> >name."
>
> >What did i do wrong?
>
>
> It could be your URLs, they contain &.
> I think & in a URL is illegal XML, you have to write & instead.
In some frameworks which are not XML aware, this can be hard. The easiest/safest
way to do this is to use CDATA
IE
<link><![CDATA[http://url/with/&/characters]]></link>
This way you can output valid XML and it would save you from screwing up in
99.9% of the cases.
The only case where you would get hit is if you URL had ]]> in it.
I use this in Emacs lisp (records-mode) so that I don't have to worry about
encoding.
... anyway. This is a good hack and I wish more people would do it.
Kevin
- --
Kevin A. Burton ( burton@apache.org, burton@openprivacy.org, burtonator@acm.org )
Cell: 408-910-6145 URL: http://relativity.yi.org ICQ: 73488596
Stuff to read:
<http://www.toad.com/gnu/whatswrong.html>
What's Wrong with Copy Protection, by John Gilmore
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: Get my public key at: http://relativity.yi.org/pgpkey.txt
iD8DBQE7cYKoAwM6xb2dfE0RAttKAJ9N1tQn8oV+dzYN2JWOFNBKX10qxACgwVXm
yYEwz47JRQgzDPCQrYP5bQY=
=mpe7
-----END PGP SIGNATURE-----