This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Xalan-based flat file mapper



(cross-posted to xalan-dev)

I spent a couple of hours on the weekend looking over the current SQL
extensions for Xalan J2 and wrote a parallel extension for line-by-line
access to an InputStream (or file).  That is, you can apply a template to
"$foo/stream/line" and iterate over the lines in the stream.  (I also made
some trivial modifications to the fake document node to allow functions that
return a NodeSet (TEXT_NODEs only) to be run within it.)

Combined with a tokenizer that respects adjacent tokens (equivalent to
Benoit Cerrina's "tokenize" that ships with the current distribution but
with a different underlying tokenizer) and the XSLT substring() function,
the result is a simple command-line tool for mapping (multi-)delimited or
fixed-width files to XML.

GPL'd Java source (along with companion command-line scripts) here:
http://www.fivesight.com/downloads/xsltflatfile.asp

Cheers,

Paul Brown
FiveSight Technologies, Inc.
prb@fivesight.com



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]