<!-- Loop Example: Transforming comma-separated values (csv)
     GPL (c) Oliver Becker, 2000-07-01
     obecker@informatik.hu-berlin.de
-->
<xslt:transform xmlns:loop="http://informatik.hu-berlin.de/loop" xmlns:xslt="http://www.w3.org/1999/XSL/Transform" version="1.0" exclude-result-prefixes="loop">

<xslt:output method="xml" indent="yes" />

<xslt:template match="text()">
   
<xslt:variable name="content" select="." />
   
<xslt:if test="$content">
      
<tokens>
         
<loop:while test="contains($content,',')">
            
<loop:do>
               
<value>
                  
<xslt:value-of select="normalize-space(substring-before( $content,','))" />
               
</value>
            
</loop:do>
            
<loop:last>
               
<value>
                  
<xslt:value-of select="normalize-space($content)" />
               
</value>
            
</loop:last>
            
<loop:update name="content" select="substring-after($content,',')" />
         
</loop:while>
      
</tokens>
   
</xslt:if>
</xslt:template>

</xslt:transform>