{"id":20668654,"url":"https://github.com/riversun/xml2node","last_synced_at":"2026-04-28T01:31:46.362Z","repository":{"id":57401914,"uuid":"140274866","full_name":"riversun/xml2node","owner":"riversun","description":"JavaScript Simple XML parser","archived":false,"fork":false,"pushed_at":"2018-07-20T02:21:19.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-15T14:21:27.921Z","etag":null,"topics":["json","parser","xml"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/riversun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-09T11:17:27.000Z","updated_at":"2018-08-22T07:30:12.000Z","dependencies_parsed_at":"2022-09-15T18:40:30.934Z","dependency_job_id":null,"html_url":"https://github.com/riversun/xml2node","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/riversun/xml2node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riversun%2Fxml2node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riversun%2Fxml2node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riversun%2Fxml2node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riversun%2Fxml2node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riversun","download_url":"https://codeload.github.com/riversun/xml2node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riversun%2Fxml2node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261777695,"owners_count":23208126,"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":["json","parser","xml"],"created_at":"2024-11-16T20:10:37.122Z","updated_at":"2026-04-28T01:31:41.343Z","avatar_url":"https://github.com/riversun.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n'xml2node' is simple XML parser for javascript allows you to parse XML into JS and access values/attributes easily.\n\nIt is licensed under [MIT license](https://opensource.org/licenses/MIT).\n\n# Quick start\n## demo on the web\nhttps://riversun.github.io/xml2node/\n\n## demo on node.js\n\n**clone this project and type**\n\n```shell\ngit clone https://github.com/riversun/xml2node.git\nnpm start\n```\n\n## install via npm\n\n```shell\nnpm install xml2node\n```\n\n# How to use?\n## Access element of XML values/attributes like as follows.\n\n### Example input-XML\n```XML\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003copml version=\"2.0\"\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eOriginal Title\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003coutline text=\"Greeting\"\u003e\n      \u003coutline text=\"We say good morning in the morning.\"/\u003e\n      \u003coutline text=\"We say hello at noon.\"/\u003e\n      \u003coutline text=\"We say good evening at night.\"/\u003e\n    \u003c/outline\u003e\n    \u003coutline text=\"Thank\"\u003e\n      \u003coutline text=\"Thank you.\"/\u003e\n      \u003coutline text=\"Appreciate it.\"/\u003e\n    \u003c/outline\u003e\n  \u003c/body\u003e\n\u003c/opml\u003e\n```\n\nYou can access XML values/attributes like this.\n```JavaScript\nvar parser = new Xml2Node.Parser();\nvar jsObject = parser.parseXML(xmlText);\nvar node=new Xml2Node.Node(jsObject);\nconsole.log(node.get(\"opml\").attr(\"version\")); // -\u003e 2.0\nconsole.log(node.get(\"opml\").get(\"head\").get(\"title\").value()); // -\u003eOriginal Title\nconsole.log(node.get(\"opml\").get(\"body\").get(\"outline\",0).attr(\"text\")); // -\u003e Greeting\nconsole.log(node.get(\"opml\").get(\"body\").get(\"outline\",0).get(\"outline\",0).attr(\"text\")); // -\u003e We say good morning in the morning.\nconsole.log(node.get(\"opml\").get(\"body\").get(\"outline\",0).get(\"outline\",1).attr(\"text\")); // -\u003e We say hello at noon.\nconsole.log(node.get(\"opml\").get(\"body\").get(\"outline\",0).get(\"outline\",2).attr(\"text\")); // -\u003e We say good evening at night.\nconsole.log(node.get(\"opml\").get(\"body\").get(\"outline\",1).attr(\"text\")); // -\u003e Thank\nconsole.log(node.get(\"opml\").get(\"body\").get(\"outline\",1).get(\"outline\",0).attr(\"text\")); // -\u003e Thank you.\nconsole.log(node.get(\"opml\").get(\"body\").get(\"outline\",1).get(\"outline\",1).attr(\"text\")); // -\u003e Appreciate it.\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friversun%2Fxml2node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friversun%2Fxml2node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friversun%2Fxml2node/lists"}