August 2013
·
68 Reads
Abstract In this technical report we propose algorithms for implementing the axes for element nodes in XPath given a DOM-like representation of the document. First, we construct algorithms for evaluating simple step expressions, withoout any (positional) predicates. The time complexity of these algorithms is at most O(l + m) where l is the size of the input list and m,the size of the output list. This improves upon results in [6] where also algorithms with linear time complexity are presented, but these are linear in the size of the entire document whereas our algorithms are linear in the size of the intermediate results which are often much smaller. In a second phase we give a description of how the support for positional predicates can be added to the algorithms with a focus on maintaining the eciency,of evaluation. Each algorithm assumes an input list that is sorted in document order and duplicate-free and returns a sorted and duplicate-free list of the result of following a certain axis from the nodes in the input list. Contents