[xsl] Strip space in Sablotron keeps unwanted (source XML) line breaks :-(

Subject: [xsl] Strip space in Sablotron keeps unwanted (source XML) line breaks :-(
From: Neil Smith <neil@xxxxxxxxxxxxxxx>
Date: Mon, 07 Apr 2003 18:15:22 +0100
Hi All -

Quick question if any of you have experience of using Sabloton on Apache / PHP platform :

I have xml file formatted for readbility as below, and in my stylesheet I'm using <xsl:strip-space elements="iCalendar vcalendar vevent" /> to remove the dead space.

Problem : I'm trying to output as a flat text file using Sablotron, and unfortunately I get 3 line breaks at the top of the output, which correspond to those in the top level elements in the source XML file.

I need to remove line breaks on output - any suggestions ? Is this a known limitation with Sablotron or have I overlooked some output encoding magic which will work ?

Source XML :

	<vcalendar version="2.0" prodid="-//hacksw/handcal//NONSGML 1.0//EN">
		<vevent id="1">
			<summary>Annual Employee Review</summary>
	(more vevents)

Stylesheet example code :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:strip-space elements="iCalendar vcalendar vevent" />
<xsl:preserve-space elements="description"/>
<xsl:param name="current" select="0" />

<xsl:template match="vevent">
<xsl:when test="@id=$current">
	<xsl:apply-templates select="dtstart"/>
	<xsl:apply-templates select="dtend"/>
	<xsl:apply-templates select="uid"/>
	<xsl:apply-templates select="summary"/>
	<xsl:apply-templates select="description"/>
	<xsl:apply-templates select="location"/>

... templates ...


<xsl:output method="text" indent="no" />

Neil Smith.

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

Current Thread