Class ContextXPathResolver


class ContextXPathResolver

This implementation replaces all variable-values in xpath- expressions with a correspondig entries in the contex before delegating the call to the parent-resolver.

Variable-values are taken from the context-entries wobzilla.local, and wobzilla.arguments. It also replaces all occurrences of position() and last() with the values provided by the context entry in wobzilla.position.

Mozilla does not provide a way to specify variables or position functions in xpath-expression (at least not through the exposed apis). This class works around this by replacing the variable-names with the variable-values before further processing the xpath expression.

Note: This method currently replaces all occurences of $ followed by a word, even if the expression is quoted e.g. '$test'. To use $ in the output you have to use the concat function. Write concat('$','test') instead of '$test'.