Answer to question -- Striping whitespace with LotusXSL

Subject: Answer to question -- Striping whitespace with LotusXSL
From: "Garriss Jr.,James P." <jgarriss@xxxxxxxxx>
Date: Wed, 13 Oct 1999 13:01:02 -0400
At 03:14 PM 10/11/99 , you wrote:
I'm using LotusXSL and have these included in my XSL stylesheet:

<xsl:output method="text" indent="no"\>
<xsl:strip-space elements="*"/>

The resulting text output file still has all the whitespace from my XSL stylesheet. Anyone know how to get rid of it? TIA,

Much thanks to Scott Boag of Lotus for figuring out what I needed to do.


In my stylesheet, I was outputting text characters like such:

  </xsl:if>
  //
</xsl:template>

I was only intending to output the double slashes, but the whitespace leading and trailing the slashes were also being output to my resulting text file. There are two fixes:

1) enclose the output in text elements, like this:

  </xsl:if>
  <xsl:text>//</xsl:text>
</xsl:template>

2) use variables, like this:

[set global variable]
<xsl:variable name="double_slash" select="'//'"/>

[reference it in template]
  </xsl:if>
  <xsl:value-of select="$double_slash"/>
</xsl:template>

Hope you find this useful,

James Garriss | The MITRE Corporation | jgarriss @ mitre.org


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



Current Thread