Although many algorithms have been proposed for evaluating XPath queries containing un-ordered axes (child, descendant, parent and ancestor) against streaming XML data, there are very few efforts towards developing algorithms for processing path expressions with ordered axes (following, followingsibling, preceding and preceding-sibling). In this paper, we show how order information can be built into the conventional twig-structure, in order to represent path expressions with following and following-sibling axes in addition to child and descendant axes. We then discuss an efficient way of encoding and matching XPath queries with forward (child, descendant, following, following-sibling) axes against streaming XML data. The algorithm processes branches of the twig in left-to-right order. A branch is never processed unless constraints specified in the preceding branches are satisfied by the stream. Also, the algorithm avoids repeated processing of branches whose constraints have already b...
Abdul Nizar, P. Sreenivasa Kumar