{"id":16583811,"url":"https://github.com/aloisdeniel/node-xmlobject","last_synced_at":"2026-04-21T14:03:04.778Z","repository":{"id":57401948,"uuid":"89401681","full_name":"aloisdeniel/node-xmlobject","owner":"aloisdeniel","description":"Convert javascript objects to and from xml strings.","archived":false,"fork":false,"pushed_at":"2017-04-27T16:01:42.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T14:16:07.437Z","etag":null,"topics":["builder","node","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/aloisdeniel.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":"2017-04-25T20:04:42.000Z","updated_at":"2017-04-26T17:52:27.000Z","dependencies_parsed_at":"2022-09-15T18:41:56.429Z","dependency_job_id":null,"html_url":"https://github.com/aloisdeniel/node-xmlobject","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aloisdeniel%2Fnode-xmlobject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aloisdeniel%2Fnode-xmlobject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aloisdeniel%2Fnode-xmlobject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aloisdeniel%2Fnode-xmlobject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aloisdeniel","download_url":"https://codeload.github.com/aloisdeniel/node-xmlobject/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242144582,"owners_count":20078970,"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":["builder","node","parser","xml"],"created_at":"2024-10-11T22:43:15.986Z","updated_at":"2026-04-21T14:03:04.726Z","avatar_url":"https://github.com/aloisdeniel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xmlobject\n\nConvert javascript object from and to xml string.\n\n## Install\n\n```sh\n$ npm install --save xmlobject\n```\n\n## Quickstart\n\n```js\nvar XML = require('xmlobject');\n\n// Deserialize from xml\n\nvar ns = \"http://www.example.com/xml/test\"\nvar defaultns = \"http://www.example.com/xml/default\"\nvar s = '\u003ca xmlns=\"'+defaultns+'\" xmlns:test=\"'+ns+'\" b=\"c\" d=\"e\"\u003e\u003ctest:f test:i=\"j\"\u003eg\u003ch /\u003e\u003c/test:f\u003e\u003c/a\u003e';\n\nXML.deserialize(s, function(err,r) {\n    console.log(r.asJSON())\n    var f1 = r.firstChild(ns,\"f\");\n    console.log(\"i: \" + f1.getAttribute(ns, \"i\"));\n    console.log(\"f: \" + f1.getText());\n\n    /* -\u003e\n    {\"name\":\"a\",\"attributes\":{\"xmlns:\":\"http://www.example.com/xml/default\",\"xmlns\":\"http://www.example.com/xml/default\",\"xmlns:test\":\"http://www.example.com/xml/test\",\"b\":\"c\",\"d\":\"e\"},\"namespaces\":[{\"prefix\":\"\",\"value\":\"http://www.example.com/xml/default\"},{\"prefix\":\"test\",\"value\":\"http://www.example.com/xml/test\"}],\"children\":[{\"name\":\"test:f\",\"attributes\":{\"test:i\":\"j\"},\"namespaces\":[],\"children\":[\"g\",{\"name\":\"h\",\"attributes\":{},\"namespaces\":[],\"children\":[]}]}]}\n    */\n\n});\n\n// Serialize to xml\n\nvar a = new XML(\"a\");\na.setAttribute(\"b\",\"c\");\na.setAttribute(\"d\",\"e\");\na.setNamespace(defaultns);\na.addNamespace(\"test\", ns);\n\nvar f = a.createChild(ns,\"f\");\nf.setAttribute(ns,\"i\",\"j\");\nf.addChild(\"g\");\nf.createChild(\"h\");\n\na.serialize(function(err, r) {\n    console.log(r);\n\n     /* -\u003e\n    \u003ca b=\"c\" d=\"e\" xmlns=\"http://www.example.com/xml/default\" xmlns:test=\"http://www.example.com/xml/test\"\u003e\u003ctest:f test:i=\"j\"\u003eg\u003ch /\u003e\u003c/test:f\u003e\u003c/a\u003e\n    */\n});\n```\n\n## Warning\n\n*xmlobject* is a perfect fit for small parsing scenario where all data could remain in memory but would not be perfectly optimized for parsing mega-octets of xml content where a stream/sax based approach would be better.\n\n## Copyright and license\n\nMIT © [Aloïs Deniel](http://aloisdeniel.github.io)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faloisdeniel%2Fnode-xmlobject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faloisdeniel%2Fnode-xmlobject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faloisdeniel%2Fnode-xmlobject/lists"}