;;; Split Record element's contents at commas ;;; After entry `Comma Seperated Data' in the XSLT FAQ ;;; See http://www.dpawson.co.uk/xsl/sect2/N1755.html#d2440e73 (lx:let ((namespace (#f "http://www.w3.org/1999/XSL/Transform") ("" "http://www.w3.org/1999/xhtml")) (dtd ((param (name #t)) ;required attribute (with-param (name #t) (select #t)) ;more than one (when (test #t)) (value-of (select #t)) (template match name) ;permitted, but not required, atts ))) (stylesheet version: 1.0 (template match: Record (:tr (call-template name: divide (with-param to-be-divided .) (with-param delimiter ',')))) (template name: divide (param to-be-divided) (param delimiter) (choose (when [contains($to-be-divided,$delimiter)] (:td (value-of [substring-before($to-be-divided,$delimiter)])) (call-template name: divide (with-param to-be-divided [substring-after($to-be-divided,$delimiter)]) (with-param delimiter ','))) (otherwise (:td (value-of $to-be-divided)))))))