{"id":18809533,"url":"https://github.com/lunarmodules/expadom","last_synced_at":"2025-07-06T20:05:54.784Z","repository":{"id":41955042,"uuid":"469861095","full_name":"lunarmodules/expadom","owner":"lunarmodules","description":"An XML DOM Level 2 Core implementation in Lua, based on the (Lua)Expat parser.","archived":false,"fork":false,"pushed_at":"2022-10-06T14:00:59.000Z","size":128,"stargazers_count":2,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-13T20:34:31.105Z","etag":null,"topics":["dom","expat","lua","luaexpat","xml"],"latest_commit_sha":null,"homepage":"https://lunarmodules.github.io/expadom/topics/01-Introduction.md.html","language":"Lua","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/lunarmodules.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":"2022-03-14T18:38:04.000Z","updated_at":"2024-06-05T20:18:25.000Z","dependencies_parsed_at":"2023-01-19T12:18:05.957Z","dependency_job_id":null,"html_url":"https://github.com/lunarmodules/expadom","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lunarmodules/expadom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarmodules%2Fexpadom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarmodules%2Fexpadom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarmodules%2Fexpadom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarmodules%2Fexpadom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lunarmodules","download_url":"https://codeload.github.com/lunarmodules/expadom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunarmodules%2Fexpadom/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263966172,"owners_count":23536814,"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":["dom","expat","lua","luaexpat","xml"],"created_at":"2024-11-07T23:16:42.054Z","updated_at":"2025-07-06T20:05:54.762Z","avatar_url":"https://github.com/lunarmodules.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expadom\n\n[![Build](https://img.shields.io/github/workflow/status/lunarmodules/expadom/Build?label=Test%20suite\u0026logo=lua)](https://github.com/lunarmodules/expadom/actions)\n[![Luacheck](https://img.shields.io/github/workflow/status/lunarmodules/expadom/Luacheck?label=Luacheck\u0026logo=lua)](https://github.com/lunarmodules/expadom/actions)\n[![Coveralls code coverage](https://img.shields.io/coveralls/github/lunarmodules/expadom?label=Coverage\u0026logo=coveralls)](https://coveralls.io/github/lunarmodules/expadom)\n[![SemVer](https://img.shields.io/github/v/tag/lunarmodules/expadom?color=brightgreen\u0026label=SemVer\u0026logo=semver\u0026sort=semver)](#history)\n[![License](https://img.shields.io/github/license/lunarmodules/expadom.svg?label=License)](https://github.com/Kong/insomnia/blob/master/LICENSE)\n\nAn [XML DOM Level 2 Core](https://www.w3.org/TR/DOM-Level-2-Core/) implementation in Lua,\nbased on the [(Lua)Expat parser](https://github.com/lunarmodules/luaexpat).\n\n## Status\n\nThis library is under early development and does not have everything implemented\nyet. Scan the code for `\"TODO:\"` to see what is still to be done.\n\n## Synopsis\n\n```lua\nlocal DOM = require(\"expadom.DOMImplementation\")()\nlocal doc, root = DOM:createDocument(nil, \"root\")\nroot:appendChild(doc:createComment(\"let's create an address list\"))\nlocal list = doc:createElement(\"addresses\")\nlist:setAttribute(\"country\", \"Netherlands\")\nroot:appendChild(list)\nlocal addr = doc:createElement(\"address\")\nlist:appendChild(addr)\naddr:appendChild(doc:createTextNode(\"address goes here\"))\n\nlocal xml_written = table.concat(doc:write())\n\n-- result (formatting added for readability):\n-- \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n-- \u003croot\u003e\n--     \u003c!--let's create an address list--\u003e\n--     \u003caddresses country=\"Netherlands\"\u003e\n--         \u003caddress\u003eaddress goes here\u003c/address\u003e\n--     \u003c/addresses\u003e\n-- \u003c/root\u003e\n\n-- now parse the document again:\nlocal xml_parsed = require(\"expadom\").parseDocument(xml_written)\nlocal address = xml_parsed:getElementsByTagName(\"address\")[1]\nprint(address.childNodes[1].nodeValue)  --\u003e \"address goes here\"\n```\n\n## Documentation\n\n[The documentation and reference](https://lunarmodules.github.io/expadom/topics/01-Introduction.md.html) is available in the `/docs` folder, and online.\n\n## Downloads, dependencies, and source code\n\nSource code and downloads are available from the [Github project page](https://github.com/lunarmodules/expadom). Installation is typically easiest using LuaRocks.\n\n### Dependencies\n\nExpadom depends on the following packages:\n\n* [LuaExpat](https://github.com/lunarmodules/luaexpat) for parsing XML. This requires\n  that [libexpat](https://github.com/libexpat/libexpat) itself is also installed.\n* The Lua module [compat53](https://github.com/keplerproject/lua-compat-5.3) is required\n  for UTF-8 support on Lua versions lacking the `utf8` module (pre Lua 5.3).\n\nWhen installing through LuaRocks, `libexpat` must be installed manually, the other\ndependencies will be dealt with by LuaRocks.\n\n## License \u0026 Copyright\n\nThe project is licensed under the [MIT License](https://github.com/lunarmodules/expadom/blob/main/LICENSE)\n\n## History\n\n#### unreleased\n\n* Feat: return root element as well when creating a document (DOMimplementation)\n  [#5](https://github.com/lunarmodules/expadom/pull/5)\n\n\n#### 22-Apr-2022 0.1.0 Initial release\n\n* Most of the DOM level 2 has been implemented\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunarmodules%2Fexpadom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunarmodules%2Fexpadom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunarmodules%2Fexpadom/lists"}