parse CDATA as DOM (with html tags parsed)

I am trying to use google maps openInfoWindowHtml to display data from a CDATA section in a static xml file which has html tags in it, like so:

<description><![CDATA[
<b>Sandi Jackson</b>, the wife of U.S. Rep. <a href=”http://www.econym.demon.co.uk”>Jesse Jackson</a>, vs. Darcel Beavers, the daughter of former alderman and Cook County Commissioner William Beavers, in a battle of political heavyweights who have already been trash-talking.
]]></description>

The code looks like this:

var description = ward.getElementsByTagName(“description”)[0];
GEvent.addListener(marker, “click”, function() {
if(description){
if(description.childNodes[0]){ marker.openInfoWindow(description.childNodes[0].nodeValue);
}
}
});
map.addOverlay(marker);

BTW, I found out a discussion about using XSLT to parse XML using Ajaxslt 0.4 in google maps mashup.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: