swatirs
December 7th, 2000, 11:57 PM
How do I insert nbsp ( or space ) using XSL
|
Click to See Complete Forum and Search --> : spaces using XSL swatirs December 7th, 2000, 11:57 PM How do I insert nbsp ( or space ) using XSL eahmed December 8th, 2000, 03:11 PM I found that using a CDATA section with a space in it useful - easiest too! shrutib February 20th, 2001, 04:18 PM The 'xsl:text' element sends literal text to the output stream. Because this element forces any white space information within it to be retained, it can be used to send multiple white space characters (those entered directly by keyboard or represented as entities) as part of a string of text. Hope this helps.... swatirs February 20th, 2001, 10:50 PM thanx for the help. I tried using xsl:text but I got the following error. Can u tell me what to do next. Do I have to put something in the header 1. When I tried using nbsp the error was : "Reference to undefined entity 'nbsp'. Error processing resource 'http://aaa/WoM/Pf/vwComp.xsl'. Line 28, Position 80 " 2. When I tried inserting simple space I got: "Keyword xsl:text may not be used in namespace http://www.w3.org/TR/WD-xsl. " shrutib February 21st, 2001, 08:34 AM Try using the following namespace..... http://www.w3.org/1999/XSL/Transform swatirs February 22nd, 2001, 03:17 AM thanx once again but now i am getting a version error. "required attribute 'version' is missing. " What version works with this? I am using 1.0 shrutib February 22nd, 2001, 11:40 AM I am not sure why you are getting the 'Version error'. I used the 'xsl:text' tag in my code and I did not get any error though I too was using version 1.0. The only limitation of this tag is that it displays only one white space even if you put more than one. Here is the sample code where I am using the 'xsl:text' tag. ?xml version="1.0"? xsl:stylesheet xmlns:xdc="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/TR/WD-xsl" xsl:template match="/" html head title Names and Addresses /title /head body xsl:apply-templates select="NAMES/NAME"/ /body /html /xsl:template xsl:template match="NAME" xdc:text This preserves the space /xdc:text B BR /BR xsl:value-of select="FIRST"/> /B BR /BR /xsl:template /xsl:stylesheet Hope this helps.... swatirs February 26th, 2001, 07:02 AM thanx a lot !!! It finally worked. I was trying to use xsl:text instead of xcd:text. It was of great help! codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |