{"_id":"xpath.js","_rev":"2992122","name":"xpath.js","description":"Xpath pure javascript implementation for node.js","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"time":{"modified":"2023-08-28T09:18:12.000Z","created":"2012-06-28T12:36:14.134Z","1.1.0":"2018-01-04T06:32:57.868Z","1.0.7":"2016-11-21T17:50:24.875Z","1.0.6":"2015-05-25T13:04:08.323Z","1.0.5":"2014-09-04T13:53:18.482Z","1.0.4":"2014-08-16T09:32:52.705Z","0.0.4":"2014-06-11T17:50:56.383Z","0.0.3":"2012-08-25T22:55:02.450Z","0.0.2":"2012-08-25T22:51:57.977Z","0.0.1":"2012-06-28T12:36:14.134Z"},"users":{},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"repository":{"type":"git","url":"git+https://github.com/yaronn/xpath.js.git"},"versions":{"1.1.0":{"name":"xpath.js","version":"1.1.0","description":"Xpath pure javascript implementation for node.js","engines":{"node":">=0.4.0"},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"dependencies":{},"devDependencies":{"nodeunit":">=0.6.4"},"repository":{"type":"git","url":"git+https://github.com/yaronn/xpath.js.git"},"main":"./xpath.js","directories":{},"scripts":{"test":"nodeunit tests/test.js"},"keywords":["xpath","xml"],"license":"MIT","gitHead":"e1e57637f1dc7ab1f415bb2f8980a18354261c88","bugs":{"url":"https://github.com/yaronn/xpath.js/issues"},"homepage":"https://github.com/yaronn/xpath.js#readme","_id":"xpath.js@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"yaron","email":"yaronn01@gmail.com"},"dist":{"shasum":"3816a44ed4bb352091083d002a383dd5104a5ff1","size":22509,"noattachment":false,"key":"/xpath.js/-/xpath.js-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/xpath.js/download/xpath.js-1.1.0.tgz"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xpath.js-1.1.0.tgz_1515047577708_0.5822539064101875"},"_cnpmcore_publish_time":"2021-12-19T12:20:32.419Z","publish_time":1515047577868,"_cnpm_publish_time":1515047577868},"1.0.7":{"name":"xpath.js","version":"1.0.7","description":"Xpath pure javascript implementation for node.js","engines":{"node":">=0.4.0"},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"dependencies":{},"devDependencies":{"nodeunit":">=0.6.4"},"repository":{"type":"git","url":"git+https://github.com/yaronn/xpath.js.git"},"main":"./xpath.js","directories":{},"scripts":{"test":"nodeunit tests/test.js"},"keywords":["xpath","xml"],"license":"Creative Commons Attribution-ShareAlike License","gitHead":"9f39a149bd96774b6b28afa400d2306c90f1a64c","bugs":{"url":"https://github.com/yaronn/xpath.js/issues"},"homepage":"https://github.com/yaronn/xpath.js#readme","_id":"xpath.js@1.0.7","_shasum":"7e94627f541276cbc6a6b02b5d35e9418565b3e4","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"yaron","email":"yaronn01@gmail.com"},"dist":{"shasum":"7e94627f541276cbc6a6b02b5d35e9418565b3e4","size":24119,"noattachment":false,"key":"/xpath.js/-/xpath.js-1.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/xpath.js/download/xpath.js-1.0.7.tgz"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/xpath.js-1.0.7.tgz_1479750622867_0.11006291676312685"},"_cnpmcore_publish_time":"2021-12-19T12:20:32.334Z","publish_time":1479750624875,"_cnpm_publish_time":1479750624875},"1.0.6":{"name":"xpath.js","version":"1.0.6","description":"Xpath pure javascript implementation for node.js","engines":{"node":">=0.4.0"},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"dependencies":{},"devDependencies":{"nodeunit":">=0.6.4"},"repository":{"type":"git","url":"https://github.com/yaronn/xpath.js.git"},"main":"./xpath.js","directories":{},"scripts":{"test":"nodeunit tests/test.js"},"keywords":["xpath","xml"],"license":"MIT","gitHead":"9ed305904cd3375640e038ecb7b6078a0ebc0af3","bugs":{"url":"https://github.com/yaronn/xpath.js/issues"},"homepage":"https://github.com/yaronn/xpath.js","_id":"xpath.js@1.0.6","_shasum":"fe4b81c1b152ebd8e1395265fedc5b00fca29b90","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"yaron","email":"yaronn01@gmail.com"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"dist":{"shasum":"fe4b81c1b152ebd8e1395265fedc5b00fca29b90","size":22829,"noattachment":false,"key":"/xpath.js/-/xpath.js-1.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/xpath.js/download/xpath.js-1.0.6.tgz"},"_cnpmcore_publish_time":"2021-12-19T12:20:31.281Z","publish_time":1432559048323,"_cnpm_publish_time":1432559048323},"1.0.5":{"name":"xpath.js","version":"1.0.5","description":"Xpath pure javascript implementation for node.js","engines":{"node":">=0.4.0"},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"dependencies":{},"devDependencies":{"nodeunit":">=0.6.4"},"repository":{"type":"git","url":"https://github.com/yaronn/xpath.js.git"},"main":"./xpath.js","directories":{},"scripts":{"test":"nodeunit tests/test.js"},"keywords":["xpath","xml"],"licenses":[{"type":"MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"gitHead":"240333f1e0ec3f58a9f740c60e82e6a92556d3ae","bugs":{"url":"https://github.com/yaronn/xpath.js/issues"},"homepage":"https://github.com/yaronn/xpath.js","_id":"xpath.js@1.0.5","_shasum":"763da39c23998b80e65e85dfbbd28ddb723da3ea","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"yaron","email":"yaronn01@gmail.com"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"dist":{"shasum":"763da39c23998b80e65e85dfbbd28ddb723da3ea","size":22868,"noattachment":false,"key":"/xpath.js/-/xpath.js-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/xpath.js/download/xpath.js-1.0.5.tgz"},"_cnpmcore_publish_time":"2021-12-19T12:20:30.235Z","publish_time":1409838798482,"_cnpm_publish_time":1409838798482},"1.0.4":{"name":"xpath.js","version":"1.0.4","description":"Xpath pure javascript implementation for node.js","engines":{"node":">=0.4.0"},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"dependencies":{},"devDependencies":{"nodeunit":">=0.6.4"},"repository":{"type":"git","url":"https://github.com/yaronn/xpath.js.git"},"main":"./xpath.js","directories":{},"scripts":{"test":"nodeunit test.js"},"keywords":["xpath","xml"],"licenses":[{"type":"MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"gitHead":"415e748375434cb52821865130cf014d57542b98","bugs":{"url":"https://github.com/yaronn/xpath.js/issues"},"homepage":"https://github.com/yaronn/xpath.js","_id":"xpath.js@1.0.4","_shasum":"0a1a85afb68521b3054b9856c83f1630bcdf354e","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"yaron","email":"yaronn01@gmail.com"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"dist":{"shasum":"0a1a85afb68521b3054b9856c83f1630bcdf354e","size":22366,"noattachment":false,"key":"/xpath.js/-/xpath.js-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/xpath.js/download/xpath.js-1.0.4.tgz"},"_cnpmcore_publish_time":"2021-12-19T12:20:29.169Z","publish_time":1408181572705,"_cnpm_publish_time":1408181572705},"0.0.4":{"name":"xpath.js","version":"0.0.4","description":"Xpath pure javascript implementation for node.js","engines":{"node":">=0.4.0"},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"dependencies":{},"devDependencies":{"nodeunit":">=0.6.4"},"repository":{"type":"git","url":"https://github.com/yaronn/xpath.js.git"},"main":"./xpath.js","directories":{},"keywords":["xpath","xml"],"licenses":[{"type":"MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"bugs":{"url":"https://github.com/yaronn/xpath.js/issues"},"homepage":"https://github.com/yaronn/xpath.js","_id":"xpath.js@0.0.4","_shasum":"46e37a3ccda20ee7164055c4d6b45da38c1c8a81","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"yaron","email":"yaronn01@gmail.com"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"dist":{"shasum":"46e37a3ccda20ee7164055c4d6b45da38c1c8a81","size":22209,"noattachment":false,"key":"/xpath.js/-/xpath.js-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/xpath.js/download/xpath.js-0.0.4.tgz"},"_cnpmcore_publish_time":"2021-12-19T12:20:28.132Z","publish_time":1402509056383,"_cnpm_publish_time":1402509056383},"0.0.3":{"name":"xpath.js","version":"0.0.3","description":"Xpath pure javascript implementation for node.js","engines":{"node":">=0.4.0"},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"dependencies":{},"devDependencies":{"nodeunit":">=0.6.4"},"repository":{"type":"git","url":"https://github.com/yaronn/xpath.js.git"},"main":"./xpath.js","directories":{},"keywords":["xpath","xml"],"licenses":[{"type":"MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"_id":"xpath.js@0.0.3","dist":{"shasum":"43f83b6762557fb40c6e124b440b899745ea40d6","size":21690,"noattachment":false,"key":"/xpath.js/-/xpath.js-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/xpath.js/download/xpath.js-0.0.3.tgz"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"_cnpmcore_publish_time":"2021-12-19T12:20:27.073Z","publish_time":1345935302450,"_cnpm_publish_time":1345935302450},"0.0.2":{"name":"xpath.js","version":"0.0.2","description":"Xpath pure javascript implementation for node.js","engines":{"node":">=0.4.0"},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"dependencies":{},"devDependencies":{"nodeunit":">=0.6.4"},"repository":{"type":"git","url":"https://github.com/yaronn/xpath.js.git"},"main":"./xpath.js","directories":{},"keywords":["xpath","xml"],"licenses":[{"type":"MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"_id":"xpath.js@0.0.2","dist":{"shasum":"c74dcc66b411ad9fb6c761ae95f5d50487862864","size":21630,"noattachment":false,"key":"/xpath.js/-/xpath.js-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/xpath.js/download/xpath.js-0.0.2.tgz"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"_cnpmcore_publish_time":"2021-12-19T12:20:25.990Z","publish_time":1345935117977,"_cnpm_publish_time":1345935117977},"0.0.1":{"name":"xpath.js","version":"0.0.1","description":"Xpath pure javascript implementation for node.js","engines":{"node":">=0.4.0"},"author":{"name":"Cameron McCormack","url":"http://mcc.id.au/xpathjs"},"dependencies":{},"devDependencies":{"nodeunit":">=0.6.4"},"repository":{"type":"git","url":"git://github.com/yaronn/xpath.js.git"},"main":"./xpath.js","directories":{},"keywords":["xpath","xml"],"licenses":[{"type":"MIT License","url":"http://www.opensource.org/licenses/mit-license.php"}],"_npmUser":{"name":"yaron","email":"yaronn01@gmail.com"},"_id":"xpath.js@0.0.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"74f36a3535f390e64409f3c68cc49e45fa216e5d","size":21598,"noattachment":false,"key":"/xpath.js/-/xpath.js-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/xpath.js/download/xpath.js-0.0.1.tgz"},"maintainers":[{"name":"yaron","email":"yaronn01@gmail.com"}],"_cnpmcore_publish_time":"2021-12-19T12:20:24.943Z","publish_time":1340886974134,"_cnpm_publish_time":1340886974134}},"readme":"## xpath.js\r\nAn xpath module for node, written in pure javascript.\r\n\r\nOriginally written by Cameron McCormack ([blog](http://mcc.id.au/xpathjs)). \r\n\r\nPrepared as a node module by Yaron Naveh ([blog](http://webservices20.blogspot.com/), [twitter](https://twitter.com/YaronNaveh)).\r\n\r\n## Install\r\nInstall with [npm](http://github.com/isaacs/npm):\r\n\r\n    npm install xpath.js\r\n\r\n\r\n\r\nxpath.js is xml engine agnostic but I recommend to use [xmldom](https://github.com/jindw/xmldom):\r\n\r\n    npm install xmldom\r\n\r\n\r\n## Your first xpath:\r\n`````javascript\r\n\tvar select = require('xpath.js')\r\n\t  , dom = require('xmldom').DOMParser\r\n\r\n\tvar xml = \"<book><title>Harry Potter</title></book>\"\r\n\tvar doc = new dom().parseFromString(xml)    \r\n\tvar nodes = select(doc, \"//title\")\r\n\tconsole.log(nodes[0].localName + \": \" + nodes[0].firstChild.data)\r\n\tconsole.log(\"node: \" + nodes[0].toString())\r\n`````\r\n-->\r\n\r\n\ttitle: Harry Potter\r\n\tNode: <title>Harry Potter</title>\r\n\r\n## Get text values directly\r\n`````javascript \r\n    var xml = \"<book><title>Harry Potter</title></book>\"\r\n    var doc = new dom().parseFromString(xml)    \r\n    var title = select(doc, \"//title/text()\")[0].data   \r\n    console.log(title)\r\n`````  \r\n-->\r\n    \r\n    Harry Potter\r\n\r\n## Namespaces\r\n`````javascript  \r\n\tvar xml = \"<book><title xmlns='myns'>Harry Potter</title></book>\"\r\n    var doc = new dom().parseFromString(xml)    \r\n    var node = select(doc, \"//*[local-name(.)='title' and namespace-uri(.)='myns/']\")[0]\r\n    console.log(node.namespaceURI)\r\n`````\r\n-->\r\n    \r\n    myns\r\n\t\r\n## Attributes\r\n`````javascript  \r\n    var xml = \"<book author='J. K. Rowling'><title>Harry Potter</title></book>\"\r\n    var doc = new dom().parseFromString(xml)    \r\n    var author = select(doc, \"/book/@author\")[0].value    \r\n    console.log(author)\r\n`````\r\n-->\r\n    \r\n    J. K. Rowling\r\n\r\n## License\r\nMIT\r\n","_attachments":{},"homepage":"https://github.com/yaronn/xpath.js#readme","bugs":{"url":"https://github.com/yaronn/xpath.js/issues"},"license":"MIT"}