Re: [xsl] xsl:text

Subject: Re: [xsl] xsl:text
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 25 Jan 2002 17:08:54 GMT
> I try to hard-code one single whitespace, but it seems
> imposiible. I tried <xsl:text> </xsl:text> as well as &#x20 or &#32; and
> even concat (as seen below) but nothing works,

all of those should work.

<xsl:template match="adlst">
    <xsl:text> -AD</xsl:text>
    <xsl:for-each select="adid">
        <xsl:text>&#32;</xsl:text>
        <xsl:value-of select="concat(' ', .)"/>
    </xsl:for-each>
</xsl:template>

that should convert XXX<adlst>1</adid><adid><adid>2</adid></adlst>XXX into

XXX -AD  1  2XXX

There are five spaces in that result, the first just befpre the -
and then  for each adid you get two more spaces one from the &#32;
and one from the ' '.

Of course if you are generating HTML then those pairs of spaces will
look in the browser like a single space, but there will be two spaces in
the html file.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread