Subject: Re: [xsl] Generating a CSV file using XSLT From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Wed, 09 Feb 2005 19:17:44 +0100 |
Any idea of how I could transform the XML doc into the following layout below in the csv file ??
With the SchemeName at the start of the .csv file then the column titles followed by the relevant rows of information from the xml doc.
Ie.
SchemeName - DATA
UniqueRecordID RegistrationNumber RegisteredName Address1, Address2, Address3, Address4,PostCode,DateComplete,DescriptionOfWorkItems... 2,02,Name,StreetName, , ,Town,SA128JW,20/01/2005,Shower,New Unit 3,03,Name,StreetName,Road , ,Town,SA128JW,20/01/2005,Shower,New Unit
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:apd="http://www.govtalk.gov.uk/people/AddressAndPersonalDetails">
<xsl:template match="BuildingRecord"> <xsl:apply-templates select=".//*[not(*)] | .//apd:*/*"/> <xsl:text> </xsl:text> </xsl:template>
<xsl:template match="BuildingRecord//* | apd:*/* "> <xsl:if test="position() > 1 ">,</xsl:if> <xsl:value-of select="normalize-space(.)"/> </xsl:template>
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) "Et ipsa scientia potestas est" - Francis Bacon , Meditationes sacrae
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Generating a CSV file usi, Ian Vaughan | Thread | RE: [xsl] Generating a CSV file usi, Ian Vaughan |
RE: [xsl] Using XML/XSLT for forms , Pieter Reint Siegers | Date | [xsl] Combining call-template with , Frans Englich |
Month |