xsl-list
[Top] [All Lists]

RE: Read data from a text file through XSLT template

2005-08-03 03:31:06
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(_at_)csgsystems(_dot_)com] 
Sent: 03 August 2005 10:16
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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


--~------------------------------------------------------------------
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>
--~--





--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>