[xsl] XSLT and comma's in XML data

Subject: [xsl] XSLT and comma's in XML data
From: "Ian Vaughan" <i.vaughan@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Feb 2005 09:01:58 -0000
I am having a problem with my XML a snippet of which is shown below


	<apd:Line>Bank, Street</apd:Line>
	<apd:Line />
	<apd:Line />


The problem I am finding is that in the XML some fields such as
<apd:Line> sometimes has data that contains a comma such as

Then when parsing this through the XSLT it is locating the comma
seperating 'Bank,Street' and splitting up the data

Any ideas on a solution would be most helpful

This is the XSLT


<xsl:stylesheet version="1.0"
<xsl:output method="text" />

<xsl:template match="/">
<xsl:text>UniqueRecordID, RegistrationNumber, RegisteredName, Address1,
Address2, Address3, Address4,PostCode, DateComplete,
<xsl:apply-templates select="//BuildingRecord"/> </xsl:template>

<xsl:template match="BuildingRecord">
<xsl:apply-templates select=".//*[not(*)]  | .//apd:*/*"/>

<xsl:template match="BuildingRecord//* | apd:*/* ">
<xsl:if test="position() &gt; 1 ">,</xsl:if>
<xsl:value-of select="normalize-space(.)"/> </xsl:template>



Current Thread