xsl-list
[Top] [All Lists]

RE: mixture of XML and HTML in result

2004-01-08 08:24:13
I need to build a page containing both html and xml.  In 
order for the proper xml to be built, I must use the xsl 
output of xml.  However, I also need non-breaking spaces 
within the html sections.  What I can't determine is how to 
litterally emit   in the result. 
<xsl:text>&#160;</xsl:text> works fine only when the output 
method is html. Thoughts? Larry

Just use &#160; in your stylesheet - although you can't see the 6
characters '& # 1 6 0 ;' in your output, the character that the
character reference references :) is still there.  HTML doesn't
normalize this kind of white space, so its ok.

For example, try:

<xsl:template match="/">
  Tree here<br/>
  &#160;grandparent<br/>
  &#160;&#160;parent<br/>
  &#160;&#160;&#160;child<br/>
</xsl:template> 

You will see that the text is indented as you intended.

cheers
andrew

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