This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: document('data.csv') fails; workaround needed
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 22 Nov 2001 17:10:30 -0000
- Subject: RE: [xsl] document('data.csv') fails; workaround needed
- Reply-to: xsl-list at lists dot mulberrytech dot com
> Is there a clever way to import CSV data into the stylesheet?
> The following fails of course:
>
> <xsl:variable name="csv" select="document('data.csv')"/>
>
Assuming a JAXP 1.1 environment:
Write yourself a parser for the CSV data, make the parser implement the SAX
XMLReader interface, and then write a URIResolver that when given the URI
"data.csv", returns a SAXSource containing this parser and the required
input file.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list