xsl-list
[Top] [All Lists]

Re: [xsl] CSV to XML transformation XSLT to include special characters?

2008-04-03 07:09:57
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--