[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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@xxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|