xsl-list
[Top] [All Lists]

Re: Losing white space when identity transform

2004-03-18 02:32:33
Hi Karl,

But am losing my white-space around the <b> elements... what is up
with that? I know this has been discussed before. Seems like there
is a fix for this.

The text before and after the <b> element is probably output according
to the template that you have for text nodes. If you're losing the
leading and trailing whitespace from those text nodes, my guess would
be that you have a template that uses normalize-space() to output the
value of the text nodes, as in:

<xsl:template match="text()">
  <xsl:value-of select="normalize-space()" />
</xsl:template>

If so, you need to change this template to:

<xsl:template match="text()">
  <xsl:value-of select="." />
</xsl:template>

(or just omit it altogether, since this is the same as the built-in
template for text nodes).

If you don't have a template like that, please send the part of your
stylesheet that deals with text nodes and we should be able to figure
out how to change it to handle the whitespace correctly.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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



<Prev in Thread] Current Thread [Next in Thread>