Can not add Google +1 button

Topics: General, Troubleshooting, XSLT
Jul 22, 2011 at 2:33 AM
Edited Jul 22, 2011 at 2:33 AM

Hi All.

Based on the tutorials of google site ( http://www.google.com/webmasters/+1/button/ ) . I copied the original code and create a new XSLT function as bellow

 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:in="http://www.composite.net/ns/transformation/input/1.0"
  xmlns:lang="http://www.composite.net/ns/localization/1.0"
  xmlns:f="http://www.composite.net/ns/function/1.0"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:g="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="xsl in lang f">

  <xsl:template match="/">
    <html>
      <head>
              <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
      </head>
      <body>
          <g:plusone></g:plusone>
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>

 

But the button can not show on my site . Is there anyone else has the same problem with me ?

Thanks.

Coordinator
Jul 22, 2011 at 6:21 AM

Hello,

Correct xmlns  g and add it to the exclude-result-prefixes:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:in="http://www.composite.net/ns/transformation/input/1.0"
xmlns:lang="http://www.composite.net/ns/localization/1.0"
xmlns:f="http://www.composite.net/ns/function/1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:g="http://code.google.com/intl/uk/apis/+1button/"
exclude-result-prefixes="xsl in lang f g">
  <xsl:template match="/">
    <html>
      <head>
        <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
      </head>
      <body>
        <g:plusone></g:plusone>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

Coordinator
Jul 25, 2011 at 1:08 PM

Just for your information: based on your topic we published a new package Composite.Community.Google.PlusOne