GNOME Bugzilla – Bug 64043
Problems with disable-output-escaping
Last modified: 2009-08-15 18:40:50 UTC
When using the xsl:text instruction by setting the attribute 'disable- output-escaping' to 'yes' the resulting document doesn't contain the characters < or &. They are always written as < or &. The instruction...: <xsl:text disable-output-escaping="yes">javascript:zoom('./zoom.html? file=abc.jpg&width=300&400');</xsl:text> ...should result in: javascript:zoom('./zoom.html?file=abc.jpg&width=300&400'); But I couldn't get it when transforming a document with xsltproc. Can you tell me please how to solve the problem?
Can't reproduce the problem: orchis:~/tmp -> cat tst.xsl <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0"> <xsl:output method="html"/> <xsl:template match="/"> <p> <xsl:text disable-output-escaping="yes">javascript:zoom('./zoom.html?file=abc.jpg&width=300&400');</xsl:text> </p> </xsl:template> </xsl:stylesheet> orchis:~/tmp -> xsltproc tst.xsl tst.xsl <p>javascript:zoom('./zoom.html?file=abc.jpg&width=300&400');</p> orchis:~/tmp -> Works with methos="xml" too ... Make sure you use a recent version. And to report all the information when you think you found a bug, including version info, input document and stylesheet. Instructions at: http://xmlsoft.org/XSLT/bugs.html Daniel
It really works when using xsl:text to generate text-content for an element. But even the latest versions of libxslt and libxml do not handle the attribute 'disable-output-escaping' when using xsl:text to generate the value for an attribute. The following example shows the problem (attribute 'href' for element 'a': <a> <xsl:attribute name="href"> <xsl:text disable-output-escaping="yes">javascript:zoom ('./zoom.html? file=abc.jpg&width=300&400');</xsl:text> </xsl:attribute> : </a>
Not a bug !!! http://www.w3.org/TR/xslt#disable-output-escaping ----------- It is an error for output escaping to be disabled for a text node that is used for something other than a text node in the result tree. Thus, it is an error to disable output escaping for an xsl:value-of or xsl:text element that is used to generate the string-value of a comment, processing instruction or attribute node; ----------- Sorry you're trying to do something which should not be supported ! Daniel
I think this can safely be closed, Daniel