tags:

views:

32

answers:

3

UPDATE:

Hi,

I've narrowed down the problem(s) and it appears to be in this part of the code:

<script type="text/javascript">
oxm_ad = {"website":"cca5e4b8-7ed2-848b-ffea-037efaac851a",
"size":"468x60",
"floor":"0.1",
"beacon":"<div id='beacon_f936906f11' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'><img src='http:\/\/www.mywebsite.com\/openx\/www\/delivery\/lg.php?bannerid=1&amp;campaignid=1&amp;zoneid=4&amp;loc=http%3a%2f%2flocalhost%2fproperty-debug%2fproperty.html&amp;cb=f936906f11&amp;bannerid=-1' width='0' height='0' alt='' style='width: 0px; height: 0px;' \/><\/div>",
"fallback":"<a href='http:\/\/www.mywebsite.com\/openx\/www\/delivery\/ck.php?oaparams=2__bannerid=1__zoneid=4__cb=f936906f11__oadest=http%3a%2f%2fwww.mywebsite.com' target='_blank'><img src='http:\/\/www.mywebsite.com\/openx\/www\/delivery\/ai.php?filename=mybanner.png&amp;contenttype=png' width='468' height='60' alt='' title='' border='0' \/><\/a><div id='beacon_f936906f11' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'><img src='http:\/\/www.mywebsite.com\/openx\/www\/delivery\/lg.php?bannerid=1&amp;campaignid=1&amp;zoneid=4&amp;loc=http%3a%2f%2flocalhost%2fproperty-debug%2fproperty.html&amp;cb=f936906f11' width='0' height='0' alt='' style='width: 0px; height: 0px;' \/><\/div>"};
</script>

Thank you.

-Laxmidi


Hi,

I'm getting error 1090, an xml parser error. My code is:

<adXMLReturn><script type="text/javascript"><!--//<![cdata[
   var m3_u = (location.protocol=='https:'?'https://www.mywebsite.com/openx/www/delivery/ajs.php':'http://www.mywebsite.com/openx/www/delivery/ajs.php');
   var m3_r = math.floor(math.random()*99999999999);
   if (!document.max_used) document.max_used = ',';
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("?zoneid=4");
   document.write ('&amp;cb=' + m3_r);
   if (document.max_used != ',') document.write ("&amp;exclude=" + document.max_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterset ? '&amp;charset='+document.characterset : ''));
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'><\/scr"+"ipt>");
//]]>--></script><script type="text/javascript" src="http://www.mywebsite.com/openx/www/delivery/ajs.php?zoneid=4&amp;amp;cb=87015091150&amp;amp;charset=utf-8&amp;amp;loc=http%3a//localhost/property-debug/property.html"&gt;&lt;/script&gt;&lt;script type="text/javascript">
oxm_ad = {"website":"cca5e4b8-7ed2-848b-ffea-037efaac851a",
"size":"468x60",
"floor":"0.1",
"beacon":"<div id='beacon_f936906f11' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'><img src='http:\/\/www.mywebsite.com\/openx\/www\/delivery\/lg.php?bannerid=1&amp;campaignid=1&amp;zoneid=4&amp;loc=http%3a%2f%2flocalhost%2fproperty-debug%2fproperty.html&amp;cb=f936906f11&amp;bannerid=-1' width='0' height='0' alt='' style='width: 0px; height: 0px;' \/><\/div>",
"fallback":"<a href='http:\/\/www.mywebsite.com\/openx\/www\/delivery\/ck.php?oaparams=2__bannerid=1__zoneid=4__cb=f936906f11__oadest=http%3a%2f%2fwww.mywebsite.com' target='_blank'><img src='http:\/\/www.mywebsite.com\/openx\/www\/delivery\/ai.php?filename=mybanner.png&amp;contenttype=png' width='468' height='60' alt='' title='' border='0' \/><\/a><div id='beacon_f936906f11' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'><img src='http:\/\/www.mywebsite.com\/openx\/www\/delivery\/lg.php?bannerid=1&amp;campaignid=1&amp;zoneid=4&amp;loc=http%3a%2f%2flocalhost%2fproperty-debug%2fproperty.html&amp;cb=f936906f11' width='0' height='0' alt='' style='width: 0px; height: 0px;' \/><\/div>"};
</script>
<script type="text/javascript" src="http://bid.openx.net/jstag"&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://bid.openx.net/json?c=oxm_72123972249&amp;amp;pid=cca5e4b8-7ed2-848b-ffea-037efaac851a&amp;amp;s=468x60&amp;amp;f=0.1&amp;amp;url=http%3a%2f%2flocalhost%2fproperty-debug%2fproperty.html"&gt;&lt;/script&gt;&lt;a href="http://www.mywebsite.com/openx/www/delivery/ck.php?oaparams=2__bannerid=1__zoneid=4__cb=f936906f11__oadest=http%3a%2f%2fwww.mywebsite.com" target="_blank"><img src="http://www.mywebsite.com/openx/www/delivery/ai.php?filename=mybanner.png&amp;amp;contenttype=png" alt="" title="" border="0" height="60" width="468"></img></a><div id="beacon_f936906f11" style="position: absolute; left: 0px; top: 0px; visibility: hidden;"><img src="http://www.mywebsite.com/openx/www/delivery/lg.php?bannerid=1&amp;amp;campaignid=1&amp;amp;zoneid=4&amp;amp;loc=http%3a%2f%2flocalhost%2fproperty-debug%2fproperty.html&amp;amp;cb=f936906f11" alt="" style="width: 0px; height: 0px;" height="0" width="0"></img></div></adXMLReturn>

When I open this code in a browser, I get:

This page contains the following errors:

error on line 1 at column 1543: error parsing attribute name Below is a rendering of the page up to the first error

oxm_ad = {"website":"cca5e4b8-7ed2-848b-ffea-037efaac851a", "size":"468x60", "floor":"0.1", "beacon":"

Does anyone know what the problem might be?

Thank you!

-Laxmidi

A: 

XML is case-sensitive. Try using CDATA instead of cdata.

Michael
And you might want to put `<![CDATA[` ... `]]>` around the content of your second script tag. The XML parser could be choking on the tags in there.
Michael
A: 

You have style='width: 0px; height: 0px;' \/>, and \ is not a valid attribute in XML.

The real problem here is that you want the content of the script element (or possibly the entire content of the adXMLReturn element) to be treated as text and you aren't encoding it properly.

If you want something to be treated as text then you need to either:

  1. Encode special characters (i.e. <, & and > should be &lt;, &amp; and &gt; respectively) or
  2. Mark them as CDATA

Note that you cannot nest CDATA sections, so if you want the entire content to be treated as text, you will need to either change the first script or use method one.

If you build your XML using an XML tool instead of by hand or using templates, then it will take care of all that for you.

On the subject of the first script, it is quite broken at the moment. Unless you really want to comment it out remove the <!-- and -->. You might want to see Comments and CDATA for more on that subject.

David Dorward
Hi David, Thank you for the message! I'm really pounding my head on this one. The code is generated by another company and I have to get it to work with my site. So, I'm trying to write replace statements to get it into the correct format. If you see anything else that I can try, pls let me know. Thanks so much.
Laxmidi
Always wonderful when third parties provide psuedo-XML. I'd start by reporting the error to them and seeing if they can fix it. Failing that, trying to preprocess it to remove the errors is probably your best option.
David Dorward
Hi David,Completely agree with you. Unfortunately, they aren't going to change the code, so I'm working on the preprocessing now. Again, thanks for your help.
Laxmidi
A: 

Hi,

Okay, I've got it figured out. The problem was in the script block that I mentioned. I had to rip out all of the blackslashes.

Thank you David and Michael for their input.

The corrected bit looks like:

<script type="text/javascript">
oxm_ad = {"website":"cca5e4b8-7ed2-848b-ffea-037efaac851a",
"size":"468x60",
"floor":"0.1",
"beacon":"<div id='beacon_f936906f11' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'><img src='http://www.mywebsite.com/openx/www/delivery/lg.php?bannerid=1&amp;amp;campaignid=1&amp;amp;zoneid=4&amp;amp;loc=http%3a%2f%2flocalhost%2fproperty-debug%2fproperty.html&amp;amp;cb=f936906f11&amp;amp;bannerid=-1' width='0' height='0' alt='' style='width: 0px; height: 0px;' /></div>",
"fallback":"<a href='http://www.mywebsite.com/openx/www/delivery/ck.php?oaparams=2__bannerid=1__zoneid=4__cb=f936906f11__oadest=http%3a%2f%2fwww.mywebsite.com' target='_blank'><img src='http://www.mywebsite.com/openx/www/delivery/ai.php?filename=mybanner.png&amp;amp;contenttype=png' width='468' height='60' alt='' title='' border='0' /></a><div id='beacon_f936906f11' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'><img src='http://www.mywebsite.com/openx/www/delivery/lg.php?bannerid=1&amp;amp;campaignid=1&amp;amp;zoneid=4&amp;amp;loc=http%3a%2f%2flocalhost%2fproperty-debug%2fproperty.html&amp;amp;cb=f936906f11' width='0' height='0' alt='' style='width: 0px; height: 0px;' /></div>"};
</script>
Laxmidi