Copyrights - Loans - Flights - Mortgage - Credit Cards

PDA

View Full Version : Getting the pubID from XML and placing it into the adsense javascript code using XSL


fcmisc
Aug 3rd 2005, 6:39 am
Hi,

I'm writing a new site. The content is all in XML and I'm formatting it with XSL. What I'd like to do is to have different adsense pub ID's for different pages, so that I can put an author's adsense ID on a page that they've written.

However, I don't know how to get the adsense ID ,from an XML node, into the javascript variable that's used by the adsense code.:confused:

Does anyone know how to do this?

Thanks,

fcmisc.

anotherchancetosee
Aug 3rd 2005, 8:24 am
Wouldn't you be able to write out a CDATA section with the XSL transformation and drop it in where appropriate? Are you doing the transform server or client side?

fcmisc
Aug 3rd 2005, 2:23 pm
Thanks for the tip. I'll look up that CDATA tomorrow as it's getting late.

I'm not sure whether or not to do the transform on the client or server. I've tried sticking adsense into a crude template. But it doesn't work in IE unless I pull out the <!-- and -->. But if I do that the whole page is blank in Netscape.

ARRRGGGHHHH!!!

I am therefore starting to lean towards server side transforms.