473,373 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,373 software developers and data experts.

firefox doesn't like 'disable-output-escaping' setting... looking for alternatives

I know 'disable-output-escaping' has been discussed in the past, but I can't
put my finger on any of the threads to see if my current problem is
addressed. Sorry for re-asking the question if it has already been
answered...

I have an XML doc that I am transforming via XSLT and JavaScript in the
browser. This allows me to return unsorted data to the browser and allow
the user to sort it with a mouseclick and not hit the server just to perform
the same query with a new sortby clause. My XSLT works fine in Internet
Explorer, but FireFox doesn't seem to respect the 'disable-output-escaping'
attribute like I'd expect. The result is that the output HTML includes <
and " instead of valid HTML.

Here's a fragment of the XML:

<Book isbn="0545010225" author="Rowling, J. K.;" pubDate="21 July 2007">
Harry Potter and the Deathly Hallows
</Book>

Here's the XSLT fragment that transforms it to HTML:

<xsl:template match="Book">

<tr>

<td class="link">

<xsl:text disable-output-escaping="yes">&lt;a
href=&quot;http://localhost/cgi-bin/book_details?isbn=</xsl:text>

<xsl:value-of select="@isbn"/>

<xsl:text disable-output-escaping="yes">&quot; target=&quot;_blank&quot;
&gt;</xsl:text>

<center><xsl:value-of select="@defectid"/></center>

<xsl:text disable-output-escaping="yes">&lt;/a&gt;</xsl:text>

</td>

<td><xsl:value-of select="@author"/></td>

<td><xsl:value-of select="@pubDate"/></td>

<td><xsl:value-of select="."/></td>

</tr>

</xsl:template>

The result HTML should look something like this:

<tr>

<td><a href="http://localhost/cgi-bin/book_details?isbn=0545010225" target="_blank"
>0545010225</a></td>
<td>Rowling, J. K.;</td>

<td21 July 2007</td>
<td>Harry Potter and the Deathly Hallows</td>

</tr>

In FireFox, the 'disable-output-escaping="yes"' is being ignored, so I end
up with:

<tr>

<td class="link">&lt;a
href=&quot;http://localhost/cgi-bin/book_detail...45010225&quot;
target=&quot;_blank&quot; &gt;0545010225&lt;/a&gt</td>

<td>Rowling, J. K.;</td>

<td21 July 2007</td>
<td>Harry Potter and the Deathly Hallows</td>

</tr>

.. not quite what I was going for. Anyone have a suggestion?

-David.

Jul 27 '07 #1
1 5428
David Henderson wrote:
I have an XML doc that I am transforming via XSLT and JavaScript in the
browser. This allows me to return unsorted data to the browser and allow
the user to sort it with a mouseclick and not hit the server just to perform
the same query with a new sortby clause. My XSLT works fine in Internet
Explorer, but FireFox doesn't seem to respect the 'disable-output-escaping'
attribute like I'd expect. The result is that the output HTML includes &lt;
and &quot; instead of valid HTML.
disable-output-escaping is an optional feature only supported when the
XSLT processor serializes the result tree. Firefox does not serialize at
all so it does not support disable-output-escaping.

Instead of

<xsl:text disable-output-escaping="yes">&lt;a
href=&quot;http://localhost/cgi-bin/book_details?isbn=</xsl:text>

<xsl:value-of select="@isbn"/>

<xsl:text disable-output-escaping="yes">&quot; target=&quot;_blank&quot;
&gt;</xsl:text>

<center><xsl:value-of select="@defectid"/></center>

<xsl:text disable-output-escaping="yes">&lt;/a&gt;</xsl:text>

you should simply use literal result elements with attribute value
templates e.g.

<a href="http://localhost/cgi-bin/book_details?isbn={@isbn}"
target="_blank"><center><xsl:value-of select="@defectid"/></a>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Els | last post by:
Hi, I would like an opinion on the following: I have a page which is made up of background-images with transparent linked images in front of it, which on hover show text in CSS popups. Due to...
10
by: Frances Del Rio | last post by:
on pop-up, which I have scripted to not show status bar, status bar still shows up in Firefox. Any way to get Firefox to open pop-ups w/o status bar at the bottom? thank you.. Frances
10
by: wayne | last post by:
I found the following script to copy text to the client clipboard but it is not working in Firefox (works fine in IE 6). Can anyone suggest what I need to change? ...
5
by: David Freeman | last post by:
Hi There! I'm using ASP.NET 1.1 and VB. Below is my DataGrid declaration... <asp:DataGrid id="myDataGrid" runat="server" AutoGenerateColumns="false"
7
by: VK | last post by:
Is it possible to include SVG object right onto HTML page in Firefox 1.5? (I mean native SVG, not SVG plugin) .... <svg> .... </svg> All samples on mozilla.org are either stay-alone .svg...
10
by: Paul Gorodyansky | last post by:
Hi, Ran into the problem today - in INPUT field Firefox executes clean-yp of the content if a user presses Esc, _before_ control goes to the code via onkeydown - and search showed that it's a...
7
by: Paul Neave | last post by:
Hi group, My website http://www.neave.com/ does not seem to work (no text appears) when viewed in Firefox 1.5 on a Mac but it works absolutely fine in every other browser I've tested on a PC,...
1
by: dev08820 | last post by:
I have a javascript function that disables the hrefs on a page by assigning "#" to each href. Th eneed to do so is to disable links in a print preview window. The print preview window contains only...
1
by: newbie009 | last post by:
How can I disable horizontal scroll in textbox for FireFox? Right now 1 textbox has vertical scroll and other textbox has horizontal scroll. It only looks like this on FireFox but it looks ugly....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.