|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: AW: import/include and apply-imports
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
|
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
|

Cart








