{"name":"xml-name-validator","description":"Validates whether a string matches the production for an XML name or qualified name","keywords":["xml","name","qname"],"version":"1.0.0","author":{"name":"Domenic Denicola","email":"d@domenic.me","url":"https://domenic.me/"},"license":"WTFPL","repository":{"type":"git","url":"https://github.com/jsdom/xml-name-validator"},"main":"lib/xml-name-validator.js","files":["lib/"],"scripts":{"prepublish":"node scripts/generate-grammar.js < lib/grammar.pegjs > lib/generated-parser.js","pretest":"npm run prepublish","test":"mocha","lint":"jshint lib && jscs lib"},"devDependencies":{"jscs":"^1.8.1","jshint":"^2.5.10","mocha":"^2.0.1","pegjs":"0.8.0"},"gitHead":"f73d690f98a1ac8b5e323bffc7fabd2478db711e","bugs":{"url":"https://github.com/jsdom/xml-name-validator/issues"},"homepage":"https://github.com/jsdom/xml-name-validator","_id":"xml-name-validator@1.0.0","_shasum":"dcf82ee092322951ef8cc1ba596c9cbfd14a83f1","_from":".","_npmVersion":"2.1.2","_nodeVersion":"0.10.33","_npmUser":{"name":"domenic","email":"domenic@domenicdenicola.com"},"maintainers":[{"name":"domenic","email":"domenic@domenicdenicola.com"}],"dist":{"shasum":"dcf82ee092322951ef8cc1ba596c9cbfd14a83f1","tarball":"http://registry-npm.ywwl.com/xml-name-validator/download/xml-name-validator-1.0.0.tgz","integrity":"sha512-XDmXffxxQs/+0VLW9NB2oSIbSoSINj6dQdhegY3kEM81LOoLr6NfsFE9RR59qrwsKEHaZLxa1MOSahFA0CE9Ow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG5xxlCTDPXJxCjWgbJsnZFS9PQFOOc1TyZwYmnQbkFRAiAt4Ek3fxC5V83lmAJonv9QY9//Iw+QjcQuWae/hhbFWA=="}],"size":4980,"noattachment":false,"key":"/xml-name-validator/-/xml-name-validator-1.0.0.tgz"},"directories":{},"readme":"# Validate XML Names and Qualified Names\n\nThis package simply tells you whether or not a string matches the [`Name`](http://www.w3.org/TR/xml/#NT-Name) or [`QName`](http://www.w3.org/TR/xml-names/#NT-QName) productions in the XML Namespaces specification. We use it for implementing the [validate](https://dom.spec.whatwg.org/#validate) algorithm in jsdom, but you can use it for whatever you want.\n\n## Usage\n\nThis package's main module exports two functions, `name()` and `qname()`. Both take a string and return a boolean indicating whether or not the string matches the relevant production.\n\n```js\n\"use strict\":\nconst xnv = require(\"xml-name-validator\");\n\n// Will return true\nxnv.name(\"x\");\nxnv.name(\":\");\nxnv.name(\"a:0\");\nxnv.name(\"a:b:c\");\n\n// Will return false\nxnv.name(\"\\\\\");\nxnv.name(\"'\");\nxnv.name(\"0\");\nxnv.name(\"a!\");\n\n// Will return true\nxnv.qname(\"x\");\nxnv.qname(\"a0\");\nxnv.qname(\"a:b\");\n\n// Will return false\nxnv.qname(\":a\");\nxnv.qname(\":b\");\nxnv.qname(\"a:b:c\");\nxnv.qname(\"a:0\");\n```\n","publish_time":1419739190159,"_cnpm_publish_time":1419739190159,"dist-tags":{"latest":"5.0.0"}}