[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] XML To CSV
Subject: Re: [xsl] XML To CSV
From: Roy <ra81@xxxxxxxxx>
Date: Thu, 29 Jul 2004 16:56:53 +0200
|
Hi Andrew,
The following stylesheet :
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates select="//Account[1]/descendant::*" />
</xsl:template>
<xsl:template match="*">
<xsl:if test = "normalize-space(text())!=''" >
<xsl:value-of select = "." />
<xsl:if test = "not(position()=last())" >
<xsl:text >,</xsl:text>
</xsl:if>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
gives the output :
1000748,1,1052.35,Mr,Joe,Bloggs
Is this what you want ?
Regards
AR
|