[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: CSV to XML transformation XSLT to include special
Hi Michael, Thanks for the alternative, but for now I want to stick with XSLT as I need to run a second transform on the XML produced from the CSV transform to create a specially formatted XML file that I can import into a module on a clients dynamic website. I have step-by-step instructions on how to do the second bit, so as I am brand new to the world of programming (no Perl knowledge unfortunatley) I will stick with what I have. Thanks again, Marney On 4/4/08 1:09 AM, "Michael Ludwig" <mlu@xxxxxxxxxxxxx> wrote: > Marney Cotterill schrieb: >> Hi Listers, >> >> I have modified an XSLT orgignally developed by Andrew Welch to >> transform a CSV to an XML for importing data into a dynamic website. I >> am brand new to XSL and XSLT and have hit a small snag with the >> transform. > > Maybe XSL is not the best tool for this job. I'd use a general-purpose > programming language like Perl to process CSV to generate XML. Perl has > modules designed to deal with practically everything, including CSV. I > think this would be much easier, while at the same time taking the > discussion off-topic. > > Well, you could then process the resulting XML in XSL to tailor it to > your needs, and that would bring the discussion back on topic. The > result would look something like this: > > <File> > <Row> > <Col>30358201</Col> > <Col>Das VIERTE</Col> > <Col>2008-04-06</Col> > </Row> > <Row> > <Col>30376055</Col> > <Col>n-tv</Col> > <Col>2008-04-05</Col> > </Row> > <Row> > <Col>30332822</Col> > <Col>Premiere Krimi</Col> > <Col>2008-04-05</Col> > </Row> > </File> > > This could then easily be processed using XSL. > > If you can handle Perl, I can mail you a script to do the job. > >> I've done some testing and I think it comes down to the inclusion of >> special characters in my CSV, which essentially breaks the transform, >> giving a blank result - it does not even display the error messege. > > This problem would be dealt with - unless your CSV data is invalid. > > Michael > > Marney Cotterill graphic designer cracker//brandware 6 Bourke Street Queens Park NSW 2022 Telephone 02 9387 2001 Facsimile 02 9387 2006 marney@xxxxxxxxxxxxxxxxxxxx www.crackerbrandware.com
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|