[thelist]   in XSL

Jonathan Chard jonathan at familygenetix.com
Tue May 8 04:38:11 CDT 2001


>> I've had some success with
>>
>> <xsl:text>&#160;</xsl:txt>
>thanks, i'll give that a shot...

Your question has prompted me on the find the 'correct' answer to this
problem, so I got out 'The complete idiots guide to XML' from the library
this weekend to look it up!! <Ahem>

Not that it told me, but it gave me a clue to go to
http://www.xml.com/pub/a/2001/03/14/trxml10.html which really did tell me.

You need to add it as an entity to your xsl stylesheet. Change your xsl
stylesheet so the top looks like this:

<?xml version="1.0"?>  <!-- or whatever your xml version is -->
<!DOCTYPE stylesheet [
<!ENTITY nbsp "&#160;">
]>
<xsl:stylesheet declation>
your xsl templates

You can then liberally sprinkle your document with &nbsp; to your hearts
content and it gets turned into the correct character. None of that PCDATA
or <xsl:text> nonsense. Much better.

Hope this works for you.

Cheers,
Jon Chard.
I use the ActiveState Komodo IDE in these situations. It lets you debug your
xsl pages, so you can inspect variables and gives you real compile errors.
Uses xalan/xerces. Pretty good, give it a shot.






More information about the thelist mailing list