[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

Subject: Re: CSV to XML transformation XSLT to include special characters?
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Thu, 03 Apr 2008 16:09:20 +0200
Re:  CSV to XML transformation XSLT to include special
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

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.