Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 20th, 2011, 11:15 AM
Authorized User
 
Join Date: Sep 2008
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default disable-output-escaping on {ImgSrc}

Hi I have this xslt line of code and my question is how do I apply disable-output-escaping on it

<img src="{ImgSrc}" title="{ImgTitle}"/>

instead of doing <xsl:value-of select="ImgTitle" disable-output-escaping="true"/>
 
Old June 20th, 2011, 11:46 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Disabling escaping is rarely correct and often doesn't work, it depends a lot on the overall process. On top of that it's not for use in attribute values, that would lead to malformed XML, i.e. text. Why would you want to in this instance? In (X)HTML for instance ampersands should be escaped in URLs.
__________________
Joe
http://joe.fawcett.name/
 
Old June 20th, 2011, 12:49 PM
Authorized User
 
Join Date: Sep 2008
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default

Actually I wanted to use it for special characters. for example ( é ) etc.
 
Old June 20th, 2011, 01:08 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

"Actually I wanted to use it for special characters. for example ( é ) etc."

Like most of the reasons beginners use disable-output-escaping, that's wrong. You don't need d-o-e to output special characters. (What's so special about é, anyway?)
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
<?javax.xml.transform.disable-output-escaping ?> robbert XSLT 5 January 5th, 2011 07:28 PM
Finding an alternative to disable-output-escaping nickbond XSLT 4 November 15th, 2006 05:28 PM
Disable-Output-Escaping in .NET Transform tclancy XSLT 3 March 1st, 2006 09:27 AM
Escaping Ampersand Entities android66 Visual Basic 2005 Basics 2 February 5th, 2005 04:46 AM
copy-of with disable-output-escaping? andrin XSLT 5 July 16th, 2004 04:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.