[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Sharing Techniques: White Spaces in HTML pages by XSLT
> > http://www.mycgiserver.com/~~lisali/papers/paper.htm > > Any comment is welcome. Perhaps you should specify more precisely what is intended by "adding whitespace to HTML pages" : does it mean (1)adding whitespace in the HTML markup (which may be normalized or stripped by the user agent), e.g. for indentation, or adding visible space to the rendered page (e.g. between words). (2) seems to be what is desired here, and it sort of can be done with  , but this method goes beyond the intent, which may be simply to prevent contiguous values from coalescing, as in : <span>Hello, <xsl:value-of select='FirstName' /> <xsl:value-of select='LastName' /></span> which gives : <span>Hello, John(U+0160)Smith</span> In fact, with   you're not really inserting whitespace, just a special character that happens to render as whitespace. In fact, what you want is HTML output that looks like this, as you would have entered it manually : <span>Hello, John Smith</span> There are at least 3 ways of obtaining this : <span>Hello, <xsl:value-of select='FirstName' /> <xsl:text> </xsl:text> <xsl:value-of select='LastName' /></span> <span xml:space="preserve">Hello, <xsl:value-of select='FirstName' /> <xsl:value-of select='LastName' /></span> <span>Hello, <xsl:value-of select="concat(FirstName,' ',LastName)" /></span> Hope this helps. Jonathan
|
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
|