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 |
<iCalendar> <vcalendar version="2.0" prodid="-//hacksw/handcal//NONSGML 1.0//EN"> <vevent id="1"> <uid>19970901T130000Z-123401@xxxxxxxx</uid> <dtstamp>19970901T130000Z</dtstamp> <dtstart>19970903T163000Z</dtstart> <dtend>19970903T190000Z</dtend> <location>Location</location> <summary>Annual Employee Review</summary> <description> </vevent> . . (more vevents) . . </vcalendar> </iCalendar>
<?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:choose> <xsl:when test="@id=$current"> <xsl:text>BEGIN:VCALENDAR
</xsl:text> <xsl:text>BEGIN:VEVENT
</xsl:text> <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"/> <xsl:text>END:VEVENT
</xsl:text> <xsl:text>END:VCALENDAR
</xsl:text> </xsl:when> </xsl:choose> </xsl:template>
Cheers, Neil Smith.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Template matching similia, Avula, Raj | Thread | RE: [xsl] Output based on the exist, Avula, Raj |
RE: [xsl] Listing things in column, Lars Huttar | Date | RE: [xsl] Output based on the exist, Lars Huttar |
Month |