|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: TEXT flat file as input
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
|
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
|






