RE: [xsl] XSLT and comma's in XML data

Subject: RE: [xsl] XSLT and comma's in XML data
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
Date: Thu, 17 Feb 2005 10:03:10 +0000
What I think that Michael Kay meant was that you should require of your input csv to have each field deliminated by quotes, that is:

"field one","field 2, containing a comma","field 3",
"etcetera",", and etcetera (also with a comma)","end"

Then you would be able to parse the CSV searching not for a comma (,) but for quote comma quote (",").

If you have no way of changing the input, you will have a hard time at it. How would any mechanism then be able to see any difference between a comma separating two fields, and a comma which is included in a given field.

Regards,
Ragulf Pickaxe :-)


----Original Message Follows---- From: "Ian Vaughan" <i.vaughan@xxxxxxxxxxxxxxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: RE: [xsl] XSLT and comma's in XML data Date: Thu, 17 Feb 2005 09:31:44 -0000

The data in the XML does not contain quotes it just contains a comma on
some fields such as

Bank,Street

Which is interfering with the following XSLT

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

And instead of Bank, Street being entered under Address 1 it is split.
So Bank goes under Address 1 and Street under Address 2 which corrupts
layout of the generated CSV file

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


Current Thread