This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:text
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 25 Jan 2002 17:08:54 GMT
- Subject: Re: [xsl] xsl:text
- References: <015901c1a5a9$2a89bb10$93ca18ac@fns.int>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> I try to hard-code one single whitespace, but it seems
> imposiible. I tried <xsl:text> </xsl:text> as well as   or   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> </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  
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