<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/xml.xsl" type="text/xsl"?><feed xmlns="http://www.w3.org/2005/Atom">
  <title>nulog, NULL::something : out of the headphone &gt; 2006 &gt; February &gt; 24 &gt; Google Adsense / XHTML</title>
  <link href="http://lowreal.net/logs/2006/02/24/3"/>
  <icon>http://lowreal.net/img/banner.png</icon>
  <link rel="self" type="application/atom+xml" href="http://lowreal.net/logs/2006/02/24/3.atom"/>
  <link rel="alternate" type="application/xhtml+xml" href="http://lowreal.net/logs/2006/02/24/3.xhtml"/>
  <updated>2006-02-24T15:23:54+09:00</updated>
  <author>
    <name>cho45(砂糖)</name>
  </author>
  <id>http://lowreal.net/2006/02/24/3</id>
  <entry>
    <title>Google Adsense / XHTML</title>
    <link rel="alternate" type="text/html" href="http://lowreal.net/logs/2006/02/24/3.html"/>
    <link rel="alternate" type="application/xml+xhtml" href="http://lowreal.net/logs/2006/02/24/3.xhtml"/>
    <updated>2006-02-24T15:23:54+09:00</updated>
    <published>2006-02-24T15:23:54+09:00</published>
    <id>http://lowreal.net/2006/02/24/3</id>
    <category term="site"/>
    <category term="web"/>
    <content type="xhtml" xml:base="http://lowreal.net/">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p><code>document.write</code> を使ってるおかげで、<code>application/xhtml+xml</code> だと使えないあの広告コードをどうにかして導入する。</p>
        <p>まー <a href="http://keystonewebsites.com/articles/adsense.php">Keystone Websites: Making AdSense work with XHTML</a> をまるパクって、<a href="/google-adsense.html">/google-adsense.html</a> を作って、あとは object 要素作っといた。</p>
        <pre>
&lt;xsl:template name="adsense"&gt;
    &lt;div class="google-adsense"&gt;
        &lt;xsl:choose&gt;
            &lt;xsl:when test="$real-flavor = 'html'"&gt;
                &lt;script type="text/javascript"&gt;&lt;xsl:comment&gt;&lt;![CDATA[
                    google_ad_client = "pub-4629424540171624";
                    google_ad_width = 468;
                    google_ad_height = 60;
                    google_ad_format = "468x60_as";
                    google_ad_type = "text";
                    google_ad_channel ="";
                    google_color_border = "000000";
                    google_color_bg = "F0F0F0";
                    google_color_link = "0000FF";
                    google_color_url = "008000";
                    google_color_text = "000000";
            ]]&gt;&lt;/xsl:comment&gt;&lt;/script&gt;
                &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;/script&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:when test="$real-flavor = 'xhtml'"&gt;
                &lt;object
                    width="468"
                    height="60"
                    data="/google-adsense.html"
                    type="text/html"&gt;&lt;/object&gt;
            &lt;/xsl:when&gt;
        &lt;/xsl:choose&gt;

    &lt;/div&gt;
&lt;/xsl:template&gt;
</pre>
      </div>
    </content>
  </entry>
</feed>
