[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT and comma's in XML data

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


<PropertyAddress>

<apd:A_5LineAddress>
	<apd:Line>Bank, Street</apd:Line>
	<apd:Line />
	<apd:Line />
	<apd:Line>Town</apd:Line>
<apd:PostCode></apd:PostCode>
</apd:A_5LineAddress>

</PropertyAddress>
...........................etc

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
'Bank,Street'

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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:apd="http://www.govtalk.gov.uk/people/AddressAndPersonalDetails">
<xsl:output method="text" />

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

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

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


</xsl:stylesheet>

-----------------------------------------------------------

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.