How to use the XPathResult function from xpath

Find comprehensive JavaScript xpath.XPathResult code examples handpicked from public code repositorys.

265
266
267
268
269
270
271
272
273
274
const rightSide = match[3];

if ((/^[.$]/).test(xPath) || (/:\/\(/).testXPath) {
  try {
    const context = this.clone({ transformNode: transformNode });
    value = leftSide + this.processWhitespace($$(this.contextNode).select(xPath, context, { type: XPath.XPathResult.STRING_TYPE })) + rightSide;
  } catch (exception) {
    value = leftSide + '[[[' + xPath + ']]]' + rightSide;
  }
} else {
fork icon4
star icon7
watch icon3

+ 152 other calls in file

323
324
325
326
327
328
329
330
331
332
if (entry.xPath && entry.xPath !== "") {
    const allParagraphs = xpath.evaluate(
        entry.xPath,
        doc,
        null,
        xpath.XPathResult.ANY_TYPE,
        null)

    let newDOM = new DOMImplementation()
    let newDoc = newDOM.createDocument(null, 'products')
fork icon0
star icon0
watch icon1

+ 59 other calls in file

25
26
27
28
29
30
31
32
33
34
while (thisRow) {
  const idCell = xpath.evaluate(
    "@objectid",
    thisRow,
    null,
    xpath.XPathResult.STRING_TYPE,
    null
  );
  const id = parseInt(idCell.stringValue.trim(), 10);
  answer.push(id);
fork icon0
star icon0
watch icon1

+ 5 other calls in file