summaryrefslogtreecommitdiffabout
path: root/content/util.js
Side-by-side diff
Diffstat (limited to 'content/util.js') (more/less context) (ignore whitespace changes)
-rw-r--r--content/util.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/util.js b/content/util.js
index c4af09e..ccc61cf 100644
--- a/content/util.js
+++ b/content/util.js
@@ -45,26 +45,33 @@ function toutf8(ucode) {
/*
* extract xpath-specified string value
*/
function xp_str(xp,x) {
var rv = x.evaluate(
xp, x, null, XPathResult.STRING_TYPE, null );
return rv.stringValue;
}
/*
* extract xpath-specified node
*/
function xp_node(xp,x) {
var rv = x.evaluate(
xp, x, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null );
return rv.singleNodeValue;
}
+/*
+ * extract xpath-specified ordered set of nodes
+ */
+function xp_nodes(xp,x) {
+ return x.evaluate(
+ xp, x, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
+}
/*
* pull in elements into documents as a member variables
*/
function pull_elements(th,d,els) {
for(var e in els) {
var en=els[e];
th[en] = d.getElementById(en);
}
}