D
David Henderson
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"><a
href="http://localhost/cgi-bin/book_details?isbn=</xsl:text>
<xsl:value-of select="@isbn"/>
<xsl:text disable-output-escaping="yes">" target="_blank"
></xsl:text>
<center><xsl:value-of select="@defectid"/></center>
<xsl:text disable-output-escaping="yes"></a></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>Rowling, J. K.;</td>
<td> 21 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"><a
href="http://localhost/cgi-bin/book_details?isbn=0545010225"
target="_blank" >0545010225</a></td>
<td>Rowling, J. K.;</td>
<td> 21 July 2007</td>
<td>Harry Potter and the Deathly Hallows</td>
</tr>
.. not quite what I was going for. Anyone have a suggestion?
-David.
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"><a
href="http://localhost/cgi-bin/book_details?isbn=</xsl:text>
<xsl:value-of select="@isbn"/>
<xsl:text disable-output-escaping="yes">" target="_blank"
></xsl:text>
<center><xsl:value-of select="@defectid"/></center>
<xsl:text disable-output-escaping="yes"></a></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>
>0545010225</a></td>
<td>Rowling, J. K.;</td>
<td> 21 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"><a
href="http://localhost/cgi-bin/book_details?isbn=0545010225"
target="_blank" >0545010225</a></td>
<td>Rowling, J. K.;</td>
<td> 21 July 2007</td>
<td>Harry Potter and the Deathly Hallows</td>
</tr>
.. not quite what I was going for. Anyone have a suggestion?
-David.