Re: [xslt] str:split, str:tokenize and empty tokens



On Mon, 2012-10-29 at 11:31 +0800, Daniel Veillard wrote:

> > "Zero-length strings will also occur in the result sequence if a
> > separator occurs at the end of the $input string, or if two adjacent
> > substrings match the supplied $pattern."
> 
>   Okay, so 'broken by design', let's keep as-is then :-)

It'd be fairly easy (I think) to implement these functions on top of the
XPath 3 versions - so a patch that (1) adds the XPath 3 ones in the "fn"
namespace, and (2) makes these functions work on top of that, might have
some mileage? But then you start pulling in the regular expression
stuff. Of course, fn:replace() would be popular too :-) assuming the
extra features were compiled conditionally of course.

The hardest part in a way is that XPath 1 didn't have sequences, but
returning a nodelist of text nodes might work as well in the meantime,
since libXML doesn't have a way to test for item types in XPath.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Co-author, 5th edition of "Beginning XML", Wrox, July 2012



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