[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xslt newbie- inserting spaces
Bruce,
At 05:26 PM 8/15/2003, you wrote: I'm back like a bad rash. Here's a question I'm sure has been asked but can't seem to traverse in the archives. Probably because it's in there so frequently -- this is the FAQest of FAQs, and used to get asked several -- many -- times a week. I'm wanting to insert spaces via my xslt stylesheet, so the html output has some blank spaces where I want them. This will insert spaces. The problem is that web browsers collapse white space for you. In particular, inside table cells if you have nothing but spaces the whole cell will fail to appear. But if you look at the source code of your serialized output, you'll see the spaces are there. Hence the problem isn't getting spaces, it's getting spaces the HTML browser will respect. The HTML entity &_nbsp; (remove underscore) is a representation of Unicode character #160, a non-breaking space, and is the usual choice for this purpose. Only XML has no hard-wired entities other than the basic markup delimiters &_lt; &_amp; etc., so you can't use this entity unless you declare it. Some people like to do this. Others simply use the numeric character reference for the same character: &_#160; or (the hex version) &_#xA0; (again, remove underscore character). If your XSLT engine is writing out HTML, you may find this gets serialized as your friend the &_nbsp;. So try <xsl:text>& #160;& #160;& #160;& #160;</xsl:text> or rather the same thing without the spaces in it. I hope this helps. --Wendell - doesn't work for me, ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|