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

RE: Read data from a text file through XSLT template

Subject: RE: Read data from a text file through XSLT template
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 3 Aug 2005 11:31:06 +0100
xslt read file
In XSLT 2.0, the unparsed-text() function makes this straightforward. Use
unparsed-text() to read the file, tokenize() to split it into lines, and
then further calls on tokenize() or xsl:analyze-string to parse the contents
of each line.

In XSLT 1.0, you can read a flat text file by pretending that it's an XML
external entity, and referencing it from an XML document that causes the
entity to be expanded. Parsing the content of the file will then typically
require recursive templates, but you may be able to reuse the existing code
in the EXSLT template library.

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

> -----Original Message-----
> From: Khorasani, Houman [mailto:houman_khorasani@xxxxxxxxxxxxxx] 
> Sent: 03 August 2005 10:16
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Read data from a text file through XSLT template
> 
> Hello,
> 
> I am assigned with a task to access a file through my XSLT 
> template and
> read line by line the usernames/passwords from the flat text file and
> store them into a variable. Or even access a database in order to get
> the username/password and store it into a variable.
> 
> This variable will be used for the further transformation / XML
> generation.
> Is that possible?  I couldn't find anything useful yet in internet.
> 
> 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-2013 All Rights Reserved.