[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: TEXT flat file as input

Subject: RE: TEXT flat file as input
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 5 Jun 2006 09:53:49 +0100
input text flat
In XSLT 2.0 this is straightforward. You can use unparsed-text() to read the
text file, and tokenize() to split it into records and fields.

In 1.0 it's a bit more convoluted. You first need to turn it into XML (by
adding a trivial start and end tag), then you need to process it using
recursive templates. But it's almost certainly possible to find reusable
code that can do this.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Khorasani, Houman [mailto:Houman.Khorasani@xxxxxxxxxxxx] 
> Sent: 05 June 2006 09:48
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  TEXT flat file as input
> 
> Sofar I have always used XSLT to transform from XML to XML.
> 
> I am working on a new project where the input file is in a text flat
> file:
> 
> account_no,123456,subscr_no,654321
> 
> Is it possible to read such a file with XSLT and transform 
> the first field until the comma into an XML element and put 
> the second field as its value and etc?
> 
> Is this a reliable way to do that?
> 
> Many Thanks,
> Houman

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-2011 All Rights Reserved.