{"id":18258763,"url":"https://github.com/manoelcampos/java-xml2lua","last_synced_at":"2026-05-01T13:31:13.296Z","repository":{"id":57726430,"uuid":"2151223","full_name":"manoelcampos/java-xml2lua","owner":"manoelcampos","description":"Java Xml2Lua: command-line tool and library to convert XML to Lua format ☕️📑💱","archived":false,"fork":false,"pushed_at":"2021-06-20T00:19:51.000Z","size":86,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T03:50:12.442Z","etag":null,"topics":["converter","java","lua","xml","xml2lua"],"latest_commit_sha":null,"homepage":"https://manoelcampos.com/JavaXml2Lua/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manoelcampos.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":"2011-08-03T21:46:30.000Z","updated_at":"2025-01-10T07:04:38.000Z","dependencies_parsed_at":"2022-09-26T17:50:52.290Z","dependency_job_id":null,"html_url":"https://github.com/manoelcampos/java-xml2lua","commit_stats":null,"previous_names":["manoelcampos/javaxml2lua"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/manoelcampos/java-xml2lua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manoelcampos%2Fjava-xml2lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manoelcampos%2Fjava-xml2lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manoelcampos%2Fjava-xml2lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manoelcampos%2Fjava-xml2lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manoelcampos","download_url":"https://codeload.github.com/manoelcampos/java-xml2lua/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manoelcampos%2Fjava-xml2lua/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32499681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["converter","java","lua","xml","xml2lua"],"created_at":"2024-11-05T10:34:30.069Z","updated_at":"2026-05-01T13:31:13.141Z","avatar_url":"https://github.com/manoelcampos.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Xml2Lua \u003ca href=\"https://buymeacoff.ee/manoelcampos\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 30px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n[![Build Status](https://github.com/manoelcampos/java-xml2lua/actions/workflows/maven.yml/badge.svg)](https://github.com/manoelcampos/java-xml2lua/actions/workflows/maven.yml)  [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.manoelcampos/xml2lua/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.manoelcampos/xml2lua) [![Javadocs](https://www.javadoc.io/badge/com.manoelcampos/xml2lua.svg)](https://www.javadoc.io/doc/com.manoelcampos/xml2lua) [![GPL licensed](https://img.shields.io/badge/license-GPL-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)\n\nThe Java Xml2Lua allows parseing a XML file and converting it to [Lua](http://lua.org) file, represented as a [table](https://www.lua.org/pil/2.5.html), the native data structure of the Lua language.\n\nIt gets a XML file such as the following as input:\n\n```xml\n\u003cproducts\u003e\n\t\u003cproduct id=\"12\"\u003e\n\t  \u003cdescription\u003eTV 32''\u003c/description\u003e\n\t  \u003cbrand\u003eSamsung\u003c/brand\u003e\n\t  \u003cprice\u003e1200\u003c/price\u003e\n\t\u003c/product\u003e\n\t\u003cproduct id=\"150\"\u003e\n\t  \u003cdescription\u003eNetbook\u003c/description\u003e\n\t  \u003cbrand\u003eAsus\u003c/brand\u003e\n\t  \u003cprice\u003e900\u003c/price\u003e\n\t\u003c/product\u003e\n\u003c/products\u003e\n```\n\nThen, it converts it to a Lua file, representing the XML data as a Lua table:\n\n```lua\nproducts =  {\n  [12]={\n    description = \"TV 32''\", brand = \"Samsung\", price = \"1200\", \n  },\n  [150]={\n    description = \"Netbook\", brand = \"Asus\", price = \"900\", \n  },\n  [198]={\n    description = \"Laser Printer\", brand = \"Samsung\", price = \"399\", \n  },\n}\n```\n\n# Using it as a Maven dependency into your own project\n\nThe library can be added as a Maven dependency into your own project, by adding the following code to your pom.xml file:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.manoelcampos\u003c/groupId\u003e\n    \u003cartifactId\u003exml2lua\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nUsing the `Xml2Lua` class to convert a XML to a Lua file requires just few lines of code:\n\n```java\nXml2Lua parser = new Xml2Lua(xmlFilePath);\nparser.convert();\nSystem.out.printf(\"Lua file generated at %s.\\n\", parser.getLuaFileName());\n```\n\n# Using it as a command line tool\n\nYou can use the available command tool to convert XML to Lua using the command line.\nIf you downloaded the project source code, when you build it using `mvn clean install`\nor some IDE, a jar file will be created inside the target directory.\n\nAlternatively, you can simply download the jar file from the [releases](https://github.com/manoelcampos/JavaXml2Lua/releases) page.\n\nOnce you have the jar file, you can run it as below:\n\n```bash\njava -jar xml2lua.jar XmlFilePath\n```\n\nThe tool will generate a Lua file with the same name of the XML file, inside the directory of the XML file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanoelcampos%2Fjava-xml2lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanoelcampos%2Fjava-xml2lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanoelcampos%2Fjava-xml2lua/lists"}