| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Accredited PayPal World Seller|
|Ampersands. HTMLencode, or CDATA?|
a choice with nuances
| 7:08 pm on Jun 13, 2008 (gmt 0)|
CDATA in attributes is forbidden.
Ampersands in attributes are forbidden.
Ampersands anywhere except CDATA are forbidden.
So if I have data that potentially contains an ampersand, I have two options:
<book title="Withnail & I"/>
<book title="Griffin & Sabine"/>
<book title="Love & Marriage"/>
<book><title><![CDATA[Withnail & I]]></title></book>
<book><title><![CDATA[Griffin & Sabine]]></title></book>
<book><title><![CDATA[Love & Marriage]]></title></book>
which would you choose?
| 10:31 am on Jun 14, 2008 (gmt 0)|
I use the first method which works for me without any problems.
| 5:11 pm on Jun 17, 2008 (gmt 0)|
I ditto Marshall.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2014 all rights reserved