Category Archives: XPath

Fizz Buzz with XPath 2.0/3.0

A few days ago Jim Fuller asked on Twitter: @xquery fizz buzz with xquery http://bit.ly/wC6Ra5 can anyone come up with a faster version ? #xquery9:00 AM Feb 26, 2012 Here are my two answers in the categories: 1) Elegant; 2) Fast … Continue reading

Posted in Performance Optimization, XPath, XPath 3.0, XSLT 2.0, XSLT 3.0 | 3 Comments

The set datatype implemented in XPath 3.0

In my previous two posts I introduced the binary search tree datatype, implemented in XPath 3.0. In most cases the binary search tree operations find, insert and delete have efficiency of O(log(d)) and the print/serialize operation is O(N*log(d)), where d … Continue reading

Posted in functional data structures, XPath, XPath 3.0 | 2 Comments

Part 2: The Binary Search Data Structure with XPath 3.0, Deleting a node

In the first part of this post I presented a Binary Search Tree implemented in pure XPath 3.0. Some new nice features of XPath 3.0 were shown in action and other, still missing but very important features were identified and … Continue reading

Posted in functional data structures, XPath, XPath 3.0 | Leave a comment

The Binary Search Tree Data Structure–having fun with XPath 3.0

For a long time I have wanted to play with XSLT 3.0 and XPath 3.0. Despite these being in their WD status, the new features are so powerful and overwhelming. Take just these: Higher Order Functions and the ability to … Continue reading

Posted in functional data structures, XPath, XPath 3.0, XSLT 3.0 | 15 Comments

XPath 2.0 Gems: Find all duplicate values in a sequence

  Someone recently asked the following question: "I have an XPath expression which provides me a sequence of values like the one below: 1 2 2 3 4 5 5 6 7 It is easy to convert this to a … Continue reading

Posted in XPath | Leave a comment