Subject: Re: [xsl] reading a .xsv file in xslt From: a kusa <akusa8@xxxxxxxxx> Date: Mon, 8 Mar 2010 14:59:59 -0600 |
Hi The csvtoxml converter works very well with single files. But if I want to convert it to work with a batch of files, how do I do it? The variable in the program 'pathtoCSV' points to only a single CSV file which gets parsed. But I want to be able to use it to work on multiple files. Any ideas/tips is appreciated. Thanks. On Wed, Feb 3, 2010 at 8:00 AM, a kusa <akusa8@xxxxxxxxx> wrote: > Thanks so much for all your responses! > > Andrew, I will try your stylesheet and let you know if I have any questions. > > > > On Wed, Feb 3, 2010 at 4:56 AM, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote: >> On 3 February 2010 10:27, ac <ac@xxxxxxxxxxxxx> wrote: >>> Hi Andrew, >>> >>> I am not sure that I understand well your point on QNames and >>> normalize-space, as if the header line is missing from the csv, picking it >>> up to try to derive element or attribute names from it is bound to generate >>> invalid QName errors, >> >> I thought you were saying there was occasionally a single blank line >> before the header line? As it stands the transform expects there to >> be a header line... if you know your csv doesnt have a header line, >> then its simple to modify the transform to put one in. If you want it >> to handle a unknown mixture of csv with and without headers, then you >> are going beyond its original goal. >> >>> '
' indeed displays as space in html but wouldn't '\r?\n' be more >>> portable? >> >> Yes, I have had the intention of correcting that for a while now :) >> >> http://markmail.org/message/64tnjaaarhu3buhk >> >> ...but the people that pay get the priority. >> >>> As a note on extending your example, the name for <root> and <row> could be >>> parametrized and I think that I would move <root> further outside the nested >>> code and allow $csvpath to be a space-delimited name list, for example, to >>> easily support csv file merge into the tree, by simply looping over the >>> tokenized file paths. >> >> I would suggest that rather do it all in one transform, you leave the >> csv-to-xml as one step, and do any further processing, such as >> combining csvs, or transforming the xml into some other xml, as >> subsequent steps in the pipeline. >> >>> Your code offers a good basic design and I especially like your regex token >>> grabber. >> >> That was done with the help of this list :) >> >> >> >> -- >> Andrew Welch >> http://andrewjwelch.com >> Kernow: http://kernowforsaxon.sf.net/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XML access control by cus, Jacobus Reyneke | Thread | Re: [xsl] reading a .xsv file in xs, Michael Ludwig |
Re: [xsl] Processing node-sets in b, Liam R E Quin | Date | [xsl] csv to xml converter- contd, a kusa |
Month |