[xml] exslt str:tokenize/str:split issue

We are using libxml2/lib(e)xslt since 2004, and very happy with it in general. Recently we discovered that str:tokenize and str:split do not always meet our expectations. The problem we have is that empty elements are silently removed. As an example, str:tokenize('abcdef,fghij, klmnop, ,,qrstuvw , xyz, ,,', ',') generates a node-set with seven elements instead of the ten we expected. Some applications (conversion of .csv based files is the obvious example) really need to know where empty fields are present. A second enhancement we would like to have (in str:tokenize only) is an indication (in an attribute of the token) of the delimiter that was present between two tokens. What is your opinion about this?

with kind regards,

Age Jan Kuperus
Wageningen UR

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]