src/xpath.js
function resolve(path, root, resolver) {
  try {
    // Add a default value to each path part lacking a prefix.
    let nspath = path.replace(/\/(?!\.)([^\/:\(]+)(?=\/|$)/g, '/_default_:$1')
    return platformResolve(nspath, root, resolver)
  } catch (err) {
    return fallbackResolve(path, root)
  }
}
function resolve(path, root, resolver) {
  try {
    // Add a default value to each path part lacking a prefix.
    let nspath = path.replace(/\/(?!\.)([^\/:\(]+)(?=\/|$)/g, '/_default_:$1')
    return platformResolve(nspath, root, resolver)
  } catch (err) {
    return fallbackResolve(path, root)
  }
}
function resolve ( path , root , resolver ) { try { // Add a default value to each path part lacking a prefix. let nspath = path . replace ( / \/(?!\.)([^\/:\(]+)(?=\/|$) / g , '/_default_:$1' ) return platformResolve ( nspath , root , resolver ) } catch ( err ) { return fallbackResolve ( path , root ) } }
Find a single node with XPath `path`
Find a single node with XPath path