?
Solved

Firefox Not displaying single quotes correctly

Posted on 2006-05-31
6
Medium Priority
?
405 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:basura
  • 3
5 Comments
 
LVL 7

Expert Comment

by:wnross
ID: 16805128
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
0
 
LVL 7

Expert Comment

by:wnross
ID: 16805265
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 ----------------------------
0
 

Author Comment

by:basura
ID: 16812001
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

0
 
LVL 7

Expert Comment

by:wnross
ID: 16812091
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
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 17068102
PAQed with points refunded (50)

CetusMOD
Community Support Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Screencast - Getting to Know the Pipeline

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question