This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: AW: import/include and apply-imports
- To: "Marcus Klinge" <klinge at karzauninkat dot de>
- Subject: Re: AW: [xsl] import/include and apply-imports
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Thu, 10 May 2001 10:19:05 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <000501c0d92b$d63ac210$32aca8c0@taurus>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Marcus,
> We have a problem concerning whitespace.
>
> The HTML output I receive looks something like this:
>
> <title>
> a value
> </title>
>
> How can I get rid of the whitespace here? indent="no" and
> xsl:strip-space where of no help.
It depends on where this output is coming from. If you have something
in the XSLT that literally has:
<title>
a value
</title>
Then you can get rid of the whitespace by getting rid of it in the
stylesheet with:
<title>a value</title>
or
<title>
<xsl:text>a value</xsl:text>
</title>
If, on the other hand, you're getting it as a value from the source
XML, then you need to normalise the string - cut off the whitespace at
the start and end - with normalize-space():
<xsl:value-of select="normalize-space(...)" />
xsl:strip-space tells the processor that *whitespace-only* text nodes
should be stripped from certain elements - it doesn't affect
whitespace that occurs within a text node that has other characters in
it as well.
The indent attribute on xsl:output is about adding whitespace
*between* elements to make the XML output more readable, not (again)
about adding or removing whitespace from text nodes that don't consist
entirely of whitespace.
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list