[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Tokenizing and transforming a CSV file
Hi Mike, Thanks for the answer. The regex below in the xsl:analyze-string instruction doesn't produce the absolutely correctly output, as I need. With the CSV I posted, I get following output by using the regex you suggested: <result> <record> <field>,"this is a long string, please tokenize me"</field> <field>,hello</field> <field>,world</field> </record> <record> <field>,please tokenize me</field> <field>,hi there</field> </record> </result> I am loosing certain fields in the output. but you said, "with a regex such as ..". I guess you gave a suggestion with no assurance of 100% reliability :) On Wed, Feb 25, 2009 at 10:23 PM, Michael Kay <mike@xxxxxxxxxxxx> wrote: > I would use xsl:analyze-string rather than tokenize(), with a regex such as > > (,"[^"]*")|(,[^,]*) > > Michael Kay > http://www.saxonica.com/ -- Regards, Mukul Gandhi
|
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
|