Skip to content

Instantly share code, notes, and snippets.

@neilalbrock
neilalbrock / atomised-truncate.xsl
Created February 20, 2009 16:06
Another take on the tolerant truncate utility.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
Author: Neil Albrock
Version: 1.0
Description: Truncate by a character limit and retain HTML content.
Usage:
<xsl:call-template name="truncate">
<xsl:with-param name="data" select="path/to/your/body" />