[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: AW: import/include and apply-imports

Subject: Re: AW: import/include and apply-imports
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 10 May 2001 10:19:05 +0100
aw 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.