{"id":18429635,"url":"https://github.com/jsdom/xml-name-validator","last_synced_at":"2025-04-13T06:40:26.238Z","repository":{"id":25131263,"uuid":"28553202","full_name":"jsdom/xml-name-validator","owner":"jsdom","description":"Validates whether a string matches the production for an XML name or qualified name","archived":false,"fork":false,"pushed_at":"2023-11-12T05:37:51.000Z","size":74,"stargazers_count":15,"open_issues_count":0,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-11T13:52:48.997Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsdom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"tidelift":"npm/jsdom"}},"created_at":"2014-12-28T03:56:57.000Z","updated_at":"2024-05-11T21:08:16.000Z","dependencies_parsed_at":"2024-06-18T14:08:30.745Z","dependency_job_id":null,"html_url":"https://github.com/jsdom/xml-name-validator","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":"0.13793103448275867","last_synced_commit":"836f307eec81279d2b1655587892e38a1effe039"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdom%2Fxml-name-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdom%2Fxml-name-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdom%2Fxml-name-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdom%2Fxml-name-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsdom","download_url":"https://codeload.github.com/jsdom/xml-name-validator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675434,"owners_count":21143763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T05:17:59.761Z","updated_at":"2025-04-13T06:40:26.218Z","avatar_url":"https://github.com/jsdom.png","language":"JavaScript","funding_links":["https://tidelift.com/funding/github/npm/jsdom"],"categories":[],"sub_categories":[],"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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdom%2Fxml-name-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsdom%2Fxml-name-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdom%2Fxml-name-validator/lists"}