![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - xsl:copy-of does not preserve disable-output-escaping >Thread Next - Re: xsl:copy-of does not preserve disable-output-escaping Re: xsl:copy-of does not preserve disable-output-escapingTo: NULL Date: 2/5/2007 6:15:00 PM shurik wrote: > Here is an example, there is a text node within a variable A. The textnode > has disable-output-escaping="yes". I need to ouput the variable A into the > result tree preserving the disable-ouput-escaping setting. > > This template: > > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:msxsl="urn:schemas-microsoft-com:xslt" > > <xsl:template match="/"> > <xsl:variable name="A"> > <xsl:text disable-output-escaping="yes"> </xsl:text> > </xsl:variable> > <xsl:copy-of select="msxsl:node-set($A)"/> > </xsl:template> > </xsl:stylesheet> > > produces " " but I need " " Why don't you just use <xsl:text>0xA0;</xsl:text> ? To your question - XSLT spec doesn't allow such tricks: "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; it is also an error to convert a result tree fragment to a number or a string if the result tree fragment contains a text node for which escaping was disabled. " In short - disable-output-escaping is output serialization feature and definitely won't work inside transformation. -- Oleg Tkachenko [XML MVP, MCPD] http://blog.tkachenko.com | http://www.XmlLab.Net | http://www.XLinq.Net | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
