![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: 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 11:42:00 PM Thank you for your reply, It looks like <xsl:text>&_#_0_1_6_0_;</txsl:text> works for me (underscores added to prevent encoding within the forum post) But I am not sure I understand why and how it works. What I need is to output the "No-Break Space" character to HTML (in the manner I described anove, a temporary tree is generated first and then copied to ouput). Which encoding should I specify in XML declaration\xsl:output directives to be sure it will work everywhere? Are there other possible issues with this solution? "Oleg Tkachenko [MVP]" wrote: > 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 | |||||
|
