[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] mixture of XML and HTML in result


Subject: RE: [xsl] mixture of XML and HTML in result
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Thu, 8 Jan 2004 16:03:58 -0000

> Except when the output mode is xml, you don't get &#160; as a 
> string of 6 characters in the output.  Instead the unicode 
> value is emitted and the IE browser does NOT render a 
> non-breaking space (at least for me).  That is why I'm trying 
> to litterally get the 6 character string. Larry

Its probable that IE is trying to view the output in the wrong encoding,
if you tell it to use utf-8 you should see your non-breaking spaces:

<xsl:stylesheet version="1.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:output method="xml" encoding="utf-8"/>

  <xsl:template match="/">

Tree here<br/>
&#160;grandparent<br/>
&#160;&#160;parent<br/>
&#160;&#160;&#160;child<br/>

  </xsl:template>

</xsl:stylesheet>

If you really want the character reference carried through to the output
as a character reference, specify an encoding that doesn't contain the
character, forcing the serializer to output a reference.  So in the
example above, change the encoding to 'ascii'.

cheers
andrew

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords