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

Re: [xsl] Entity Questions


Subject: Re: [xsl] Entity Questions
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 17 Jan 2005 15:49:05 GMT

  <?xml version="1.0"?>
  <!DOCTYPE xsl:stylesheet [
  <!ENTITY nbsp '&#160;'>
  ]>

there's not a lot of point doing this (although some people do it)
it just means that you can enter a non breaking space as & nbsp; in the
stylesheet rather than & #160;  which actually is no harder to type
and doesn't need any DOCTYPE declaration.

It makes no difference to the output how you input the character, both
the entity reference to nbsp and the character referenceto 160 will have
been replaced by the XML parser by the actual character before XSLt
starts so the XSLT engine itself never sees any distinction.


  The problem is the &nbsp; is still being outputted by a template in this
  style sheet. It should be converted to &#160;, shouldn't it?

That means that you are outputting in html mode not xml mode.
Either you have <xsl:output method="html"/> or you have a top level
element in your generated result called html, both of these would be
undesirable if you are generating XSL-FO output.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


Current Thread
Keywords