Link to home
Start Free TrialLog in
Avatar of basura
basura

asked on

Firefox Not displaying single quotes correctly

Hi we are implementing an XSL transformation that needs to display correctlyu on both FIRE FOX and IE

here is the XML and the XSL

XML:

  <?xml version="1.0" encoding="UTF-8" ?>
- <!--  generator="wordpress/2.0.2"
  -->
- <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/">
- <channel>
  <title>BetReturns</title>
  <link>http://wordpress.ssincorporated.com</link>
  <description>Just another WordPress weblog</description>
  <pubDate>Wed, 31 May 2006 23:23:52 +0000</pubDate>
  <generator>http://wordpress.org/?v=2.0.2</generator>
  <language>en</language>
- <item>
  <title>Apóstrofe</title>
  <link>http://wordpress.ssincorporated.com/?p=7</link>
  <comments>http://wordpress.ssincorporated.com/?p=7#comments</comments>
  <pubDate>Wed, 31 May 2006 23:23:52 +0000</pubDate>
  <dc:creator>ricardo</dc:creator>
  <category>Uncategorized</category>
  <guid isPermaLink="false">http://wordpress.ssincorporated.com/?p=7</guid>
- <description>
- <![CDATA[ A&#8217;s B&#8217;s C&#8217;s D&#8217;s E&#8217;s


  ]]>
  </description>
  <wfw:commentRSS>http://wordpress.ssincorporated.com/?feed=rss2&p=7</wfw:commentRSS>
  </item>
- <item>
  <title />
  <link>http://wordpress.ssincorporated.com/?p=6</link>
  <comments>http://wordpress.ssincorporated.com/?p=6#comments</comments>
  <pubDate>Wed, 31 May 2006 23:03:11 +0000</pubDate>
  <dc:creator>ricardo</dc:creator>
  <category>Uncategorized</category>
  <guid isPermaLink="false">http://wordpress.ssincorporated.com/?p=6</guid>
- <description>
- <![CDATA[
Let&#8217;s write a NEAT HTML ARTICLE !!!!!!!

With
bullet
points
and shit
like



this
!!
Yay!



  ]]>
  </description>
  <wfw:commentRSS>http://wordpress.ssincorporated.com/?feed=rss2&p=6</wfw:commentRSS>
  </item>
- <item>
  <title>Yet another test…</title>
  <link>http://wordpress.ssincorporated.com/?p=5</link>
  <comments>http://wordpress.ssincorporated.com/?p=5#comments</comments>
  <pubDate>Wed, 31 May 2006 01:51:39 +0000</pubDate>
  <dc:creator>ricardo</dc:creator>
  <category>Uncategorized</category>
  <guid isPermaLink="false">http://wordpress.ssincorporated.com/?p=5</guid>
- <description>
- <![CDATA[ AN FRANCISCO (Business 2.0 Magazine) - On the Web, Google may have search all wrapped up. But search on cell phones is still a wide-open, fast-growing field that some startups think will make a good business.There are plenty of reasons to be skeptical. For one, there&#8217;s the state of Web access on cell phones. If [...]
  ]]>
  </description>
  <wfw:commentRSS>http://wordpress.ssincorporated.com/?feed=rss2&p=5</wfw:commentRSS>
  </item>
  </channel>
  </rss>



here is the XSL


<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output encoding="UTF-8" method="html" indent="yes"/>
      <xsl:template match="/">
            <table class="blogContentTable" cellpadding="10" cellspacing="0">
                  <xsl:for-each select="/rss/channel/item">
                        <tr>
                              <td>
                                    <img src="inc/images/br_red_bullet.gif" width="6" height="6"/>&#160; <strong>
                                          <xsl:value-of select="substring-before(pubDate,' ' )"/>
                                          <xsl:text disable-output-escaping="yes">&#160;</xsl:text>
                                          <xsl:value-of
                                                select="substring-before(substring-after(pubDate,' '),' ')"/>
                                          <xsl:text disable-output-escaping="yes">&#160;</xsl:text>
                                          <xsl:value-of
                                                select="substring-before(substring-after(substring-after(pubDate,' '),' '),' ')"/>
                                          <xsl:text disable-output-escaping="yes">&#160;</xsl:text>
                                          <xsl:value-of
                                                select="substring-before(substring-after(substring-after(substring-after(pubDate,' '),' '),' '),' ')"/>

                                    </strong>
                                    <br/>
                                    <a href="{link}">
                                          <xsl:if test="string-length(title) &gt; 0">
                                                <xsl:value-of select="title"/>
                                          </xsl:if>
                                          <xsl:if test="string-length(title) = 0">
                                                <xsl:text disable-output-escaping="yes" >Untitled</xsl:text>
                                          </xsl:if>
                                    </a>
                                    <br/>
                                    <xsl:value-of select="description" disable-output-escaping="yes"/>
                                    <a href="{link}">More&gt;&gt;</a><br/><br/>
                              </td>
                        </tr>
                  </xsl:for-each>
            </table>
      </xsl:template>
</xsl:stylesheet>


the problem is the following:

on IE  it displays correctly:

Wed, 31 May 2006
Untitled
Let’s write a NEAT HTML ARTICLE !!!!!!! With bullet points and shit like

note the single quote or apostrophe   in  "let's"


on FIREFOX displays like this:

Wed, 31 May 2006
Untitled
Let&#8217;s write a NEAT HTML

note the &#8217;   that is being displayed  



please help
Avatar of wnross
wnross

Well, for starters your XML is not well formed:

 you have three unescaped & characters,
  <title>Apóstrofe</title>                      <-- contains non UTF-8 character ó
  <title>Yet another test…</title>          <-- contains non UTF-8 character …

The XML did not parse under either MSIE 6 or Mozilla 1.7 until I repaired/removed the offending items

I'll post back in a sec as soon as I get a stylesheet transformation

Cheers,
-Bill
disable-output-escaping is an optional feature of XSLT: not every
processor implements it, since you are escaping unicode characters anyway, send them in as plain XML:

-----------------------  SNIP ------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
 <!--  generator="wordpress/2.0.2"
  -->
 <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"

xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/">
 <channel>
  <title>BetReturns</title>
  <link>http://wordpress.ssincorporated.com</link>
  <description>Just another WordPress weblog</description>
  <pubDate>Wed, 31 May 2006 23:23:52 +0000</pubDate>
  <generator>http://wordpress.org/?v=2.0.2</generator>
  <language>en</language>
 <item>
  <title>Apostrofe</title>
  <link>http://wordpress.ssincorporated.com/?p=7</link>
  <comments>http://wordpress.ssincorporated.com/?p=7#comments</comments>
  <pubDate>Wed, 31 May 2006 23:23:52 +0000</pubDate>
  <dc:creator>ricardo</dc:creator>
  <category>Uncategorized</category>
  <guid isPermaLink="false">http://wordpress.ssincorporated.com/?p=7</guid>
 <description>
 A&#8217;s B&#8217;s C&#8217;s D&#8217;s E&#8217;s


  </description>
  <wfw:commentRSS>http://wordpress.ssincorporated.com/?feed=rss2&p=7</wfw:commentRSS>
  </item>
 <item>
  <title />
  <link>http://wordpress.ssincorporated.com/?p=6</link>
  <comments>http://wordpress.ssincorporated.com/?p=6#comments</comments>
  <pubDate>Wed, 31 May 2006 23:03:11 +0000</pubDate>
  <dc:creator>ricardo</dc:creator>
  <category>Uncategorized</category>
  <guid isPermaLink="false">http://wordpress.ssincorporated.com/?p=6</guid>
 <description>
Let&#8217;s write a NEAT HTML ARTICLE !!!!!!!

With
bullet
points
and shit
like



this
!!
Yay!



  </description>
  <wfw:commentRSS>http://wordpress.ssincorporated.com/?feed=rss2&p=6</wfw:commentRSS>
  </item>
 <item>
  <title>Yet another test...</title>
  <link>http://wordpress.ssincorporated.com/?p=5</link>
  <comments>http://wordpress.ssincorporated.com/?p=5#comments</comments>
  <pubDate>Wed, 31 May 2006 01:51:39 +0000</pubDate>
  <dc:creator>ricardo</dc:creator>
  <category>Uncategorized</category>
  <guid isPermaLink="false">http://wordpress.ssincorporated.com/?p=5</guid>
 <description>
 AN FRANCISCO (Business 2.0 Magazine) - On the Web, Google may have search all wrapped up. But search on cell phones

is still a wide-open, fast-growing field that some startups think will make a good business.There are plenty of

reasons to be skeptical. For one, there&#8217;s the state of Web access on cell phones. If [...]
  </description>
  <wfw:commentRSS>http://wordpress.ssincorporated.com/?feed=rss2&p=5</wfw:commentRSS>
  </item>
  </channel>
  </rss>
------------------------------ SNIP ----------------------------
Avatar of basura

ASKER

It has been solved thank you.

first of all the question was about the transformation and the actual fact that FireFox was not doing as asked by the xslt but doing whatever they wanted.

. Basically FireFox does not implement it because they just don't want to wich seems a little bit annoying from the people that profetize standards.

Changing the XML was not an option.

We did it doing server side convertion in .net  wich took care of the issue for now until Firefox decides to implement disable output escaping

I think you will run into this again, like I mentioned, disable-output-escaping is an *optional* capability for XSLT.

heh, sometimes the answer is "No" I guess, cheers,
-Bill
ASKER CERTIFIED SOLUTION
Avatar of CetusMOD
CetusMOD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial