Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike McCullough 54 posts 67 karma points
    Feb 11, 2011 @ 15:05
    Mike McCullough
    0

    Facebook Comments XSLT Issue

    My XML is getting messed up using the FB markup language.  For Example:

     

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
    version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:fb="http://www.facebook.com/2008/fbml"
    xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:MailEngine="urn:MailEngine" 
    exclude-result-prefixes="fb msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets MailEngine ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:param name="currentPage"/>
    <xsl:variable name="domain" select="'http://'" />
    <xsl:variable name="url" select="concat($domain,umbraco.library:RequestServerVariables('SERVER_NAME'))" />
    <xsl:variable name="AppId" select="/macro/AppId" />
    <xsl:template match="/">
    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js#appId={$AppId}&amp;xfbml=1" type="text/javascript"></script>
    <fb:comments xid="{$url}{umbraco.library:NiceUrl($currentPage/@id)}" numposts="10" width="225" publish_feed="true"></fb:comments>

    </xsl:template>
    </xsl:stylesheet>

    My output is:

       <div id="fb-root"></div>
       <script src="http://connect.facebook.net/en_US/all.js#appId=000&amp;xfbml=1" type="text/javascript"></script>
       <fb:comments xid="http://www.mysite.com/default.aspx" numposts="10" width="225" publish_feed="true" xmlns:fb="http://www.facebook.com/2008/fbml" /> 
    

     

    My problem is at the end of the fb element, I can't get rid of it!

     

    xmlns:fb="http://www.facebook.com/2008/fbml"

     

  • Jason Prothero 422 posts 1243 karma points MVP c-trib
    Feb 12, 2011 @ 00:34
    Jason Prothero
    0

    Is your problem the empy tags?

    I.e.

    <div id="fb-root"></div>

    You may need an empty string in there or else the XSLT makes it

    <div id="fb-root" />

    Which most browsers don't like.

    Try:

    <div id="fb-root"><xsl:value-of select="''" /></div>
  • Jim Lesinski 32 posts 54 karma points
    Mar 30, 2011 @ 19:07
    Jim Lesinski
    0

    Did you find a resolution to this?

  • Laurent Lequenne 123 posts 248 karma points
    Mar 31, 2011 @ 11:45
    Laurent Lequenne
    0

    <xsl:output method="html" omit-xml-declaration="yes"/>

    This is not the X Mickey L World :-)

  • Jim Lesinski 32 posts 54 karma points
    Mar 31, 2011 @ 19:15
    Jim Lesinski
    0

    Thanks Laurent! Works perfectly. 

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies