Subject:how to parse a html element for apostrophe Author:v c Date:25 Jan 2008 07:23 PM
Hello,
I have an XML file and one of the nodes contain an image tag. The problem is that the image filename or the ALT text can have an apostrophe and it terminates abnormally in the javascript array once loaded in my HTML page.
<root>
<GalleryPictures>
<Picture>
<topImage><img src="/images/JohnO'DoulsMugShot.jpg" alt="John O'Douls Mug Shot"></topImage>
<description>This is a picture of John O'Doul.</description>
<Picture>
</GalleryPictures>
</root>
If there is a better way of doing this please tell.