{"id":27938892,"url":"https://github.com/xiyoo0812/luaxml","last_synced_at":"2026-04-28T00:33:02.779Z","repository":{"id":238803452,"uuid":"797606936","full_name":"xiyoo0812/luaxml","owner":"xiyoo0812","description":"lua bindings for tinyxml2！","archived":false,"fork":false,"pushed_at":"2025-03-03T08:13:05.000Z","size":53,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T05:40:45.819Z","etag":null,"topics":["lua","xml"],"latest_commit_sha":null,"homepage":"","language":"C++","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/xiyoo0812.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-08T07:05:26.000Z","updated_at":"2025-03-03T08:13:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"aed4c37e-4b70-4453-b4fc-6c6ea5725b61","html_url":"https://github.com/xiyoo0812/luaxml","commit_stats":null,"previous_names":["xiyoo0812/luaxml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xiyoo0812/luaxml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiyoo0812%2Fluaxml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiyoo0812%2Fluaxml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiyoo0812%2Fluaxml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiyoo0812%2Fluaxml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiyoo0812","download_url":"https://codeload.github.com/xiyoo0812/luaxml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiyoo0812%2Fluaxml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["lua","xml"],"created_at":"2025-05-07T08:58:19.854Z","updated_at":"2026-04-28T00:33:02.773Z","avatar_url":"https://github.com/xiyoo0812.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# luaxml\r\nlua bindings for tinyxml2(https://github.com/leethomason/tinyxml2).\r\n\r\n# 依赖\r\n- [lua](https://github.com/xiyoo0812/lua.git)5.3以上\r\n- [luakit](https://github.com/xiyoo0812/luakit.git)一个luabind库\r\n- [tinyxml2](https://github.com/leethomason/tinyxml2)，源码已经包含在内\r\n- 项目路径如下\u003cbr\u003e\r\n  |--proj \u003cbr\u003e\r\n  \u0026emsp;|--lua \u003cbr\u003e\r\n  \u0026emsp;|--luaxml \u003cbr\u003e\r\n  \u0026emsp;|--luakit\r\n\r\n# 接口说明\r\n```lua\r\nlocal xml = require(\"luaxml\")\r\n--编码\r\n--value: 输入的lua table\r\n--header: xml的自定义头，不传使用默认\r\n--res：输出xml字符串\r\n--err：错误信息\r\nlocal res, err = xml.encode(value)\r\nlocal res, err = xml.encode(value, 'xml version=\"1.0\" encoding=\"gbk\"')\r\n\r\n--解码\r\n--value: 输入的xml字符串\r\n--res：输出lua\r\nlocal res = xml.decode(value)\r\n\r\n--保存到文件\r\n--xmlfile: 保存的xml文件名\r\n--value: 输入的lua\r\n--header: xml的自定义头，不传使用默认\r\n--res：成功或者失败\r\nlocal ok = xml.save(\"./bb.xml\", xxlua, 'xml version=\"1.0\" encoding=\"gbk\"')\r\n\r\n--从文件读取\r\n--xmlfile: 读取的xml文件名\r\n--res：输出xml字符串\r\n--err：错误信息\r\nlocal flua, ferr = xml.open(\"./bb.xml\")\r\n\r\n```\r\n\r\n# 用法参考\r\n```lua\r\n--本示例使用了quanta引擎\r\n--https://github.com/xiyoo0812/quanta.git\r\n\r\nlocal log_dump  = logger.dump\r\n\r\nlocal cxml = [[\r\n\u003cXperiML version=\"2.0\"\u003e\r\n  \u003c!--  application info --\u003e\r\n  \u003capplicationInfo\u003e\r\n    \u003cstring id=\"author\"\u003e     J\u0026#228;ne.Roe@t\u0026#252;bingen.com \u003c/string\u003e\r\n    \u003cstring id=\"version\"\u003e    0.5.0                         \u003c/string\u003e\r\n    \u003cstring id=\"date\"\u003e       2004-11-23 - 2006-08-18       \u003c/string\u003e\r\n    \u003cstring id=\"shortDescr\"\u003e a demonstration application for veLib Lua scripting \u003c/string\u003e\r\n    \u003cstring id=\"usage\"\u003e      [ -i(ini.xml) ] \u003c/string\u003e\r\n    \u003ctag id=\"emptyAttr\" attr=\"\" /\u003e\r\n  \u003c/applicationInfo\u003e\r\n\r\n\u003c!--  initialization of the glWindow --\u003e\r\n  \u003cdeviceWindow id=\"0\" name=\"window\" deviceContainer=\"input\"\u003e\r\n    \u003cstring id=\"winTitle\"\u003e   veLua \u003c/string\u003e\r\n    \u003cfloat id=\"mouseRelative\"\u003e     0 \u003c/float\u003e\r\n    \u003cfloat id=\"mouseNeutral\"\u003e    0.0 \u003c/float\u003e\r\n    \u003cbool id=\"mouseVisible\"\u003e       0 \u003c/bool\u003e\r\n    \u003cbool id=\"fullScreen\"\u003e         0 \u003c/bool\u003e\r\n    \u003cint  id=\"zBufferBits\"\u003e       24 \u003c/int\u003e\r\n    \u003cint  id=\"stencilBufferBits\"\u003e  0 \u003c/int\u003e\r\n\r\n    \u003cint id=\"winSizeX\"\u003e        800 \u003c/int\u003e\r\n    \u003cint id=\"winSizeY\"\u003e        600 \u003c/int\u003e\r\n    \u003cfloatArray id=\"bgColor\"\u003e 0.5 0.6 0.7 \u003c/floatArray\u003e\r\n\r\n    \u003c!-- 2d viewport / overlay initialization --\u003e\r\n    \u003coverlay\u003e\r\n      \u003cfloatArray id=\"bgNormalColor\"\u003e 1.0 1.0 1.0 0.2 \u003c/floatArray\u003e\r\n      \u003cfloatArray id=\"fgNormalColor\"\u003e 1.0 0.0 1.0 0.7 \u003c/floatArray\u003e\r\n      \u003cfloatArray id=\"bgSelectColor\"\u003e 0.0 0.5 1.0 0.7 \u003c/floatArray\u003e\r\n      \u003cfloatArray id=\"fgSelectColor\"\u003e 1.0 1.0 1.0 1.0 \u003c/floatArray\u003e\r\n      \u003c!-- overlay plane minimum and maximum coordinates --\u003e\r\n      \u003cfloat id=\"minX\"\u003e -1.0 \u003c/float\u003e\r\n      \u003cfloat id=\"minY\"\u003e -1.0 \u003c/float\u003e\r\n      \u003cfloat id=\"maxX\"\u003e  1.0 \u003c/float\u003e\r\n      \u003cfloat id=\"maxY\"\u003e  1.0 \u003c/float\u003e\r\n    \u003c/overlay\u003e\r\n\r\n    \u003c!--                 X   Y   Z   H   P   R (output axes) --\u003e\r\n    \u003caxesInputMapping\u003e   0   1   2   3   4   5 \u003c/axesInputMapping\u003e\r\n    \u003caxesInputScale\u003e     1   1   1   1   1   1 \u003c/axesInputScale\u003e\r\n    \u003caxesInputShift\u003e     0   0   0   0   0   0 \u003c/axesInputShift\u003e\r\n  \u003c/deviceWindow\u003e\r\n  \u003cdeviceGraphics id=\"0\"\u003e\r\n    \u003c!-- 3d viewport initialization --\u003e\r\n    \u003cfloat id=\"nearClipping\"\u003e  0.1 \u003c/float\u003e\r\n    \u003cfloat id=\"farClipping\"\u003e   2000 \u003c/float\u003e\r\n    \u003cfloat id=\"frustumLeft\"\u003e  -1.0 \u003c/float\u003e\r\n    \u003cfloat id=\"frustumRight\"\u003e  1.0 \u003c/float\u003e\r\n    \u003cfloat id=\"frustumBottom\"\u003e-.75 \u003c/float\u003e\r\n    \u003cfloat id=\"frustumTop\"\u003e    .75 \u003c/float\u003e\r\n    \u003cbool id=\"backFaceCulling\"\u003e       1    \u003c/bool\u003e\r\n    \u003c!--  camera initialization  --\u003e\r\n    \u003ccamera object=\"observer\" pos=\"0 -3 1.6 0 0 0\"/\u003e\r\n  \u003c/deviceGraphics\u003e\r\n\r\n \u003c!--  audio device initialization  --\u003e\r\n  \u003cdeviceAudio id=\"0\" class=\"deviceAudioAL\"\u003e      \u003c!-- specific global settings for OpenAL --\u003e\r\n    \u003cint   id=\"distanceModel\"\u003e       1   \u003c/int\u003e   \u003c!-- valid arguments are NONE=0, INVERSE_DISTANCE=1 (default), INVERSE_DISTANCE_CLAMPED=2, see OpenAL ref. man. p.21 --\u003e\r\n    \u003cfloat id=\"dopplerVelocity\"\u003e   330.0 \u003c/float\u003e \u003c!-- corresponds to sonic speed for doppler effect calculations --\u003e\r\n    \u003cfloat id=\"dopplerFactor\"\u003e       1.0 \u003c/float\u003e \u003c!-- additional scaling factor for doppler effect calculations --\u003e\r\n  \u003c/deviceAudio\u003e\r\n  \u003c!-- resource definition --\u003e\r\n  \u003cresources\u003e\r\n    \u003cresource mime=\"model/vrml\" id=\"1\"  name=\"virtualab\"   url=\"resources/virtualab.wrl\"/\u003e\r\n    \u003cresource mime=\"model/vrml\" id=\"2\"  name=\"surface\"     url=\"resources/virtualab_surface.wrl\"/\u003e\r\n    \u003cresource mime=\"model/vrml\" id=\"3\"  name=\"cube\"        url=\"resources/box.wrl\"/\u003e\r\n    \u003cresource mime=\"model/vrml\" id=\"5\"  name=\"ball\"        url=\"resources/ball01.wrl\"/\u003e\r\n    \u003cresource mime=\"image/png\"  id=\"6\"  name=\"veRner\"      url=\"resources/veRner_small.png\" sizeX=\"6\" sizeY=\"3\"/\u003e\r\n    \u003cresource mime=\"image/png\"  id=\"7\"  name=\"explo\"       url=\"resources/explo.png\" sizeX=\"3\" sizeY=\"3\" timeSpan=\"1.0\" loop=\"true\" tileX=\"4\" tileY=\"4\" usePitch=\"true\"/\u003e\r\n    \u003cresource mime=\"font/txf\"    id=\"10\" name=\"default\"    url=\"default.txf\" size=\"24\"/\u003e\r\n    \u003cresource mime=\"audio/wav\" id=\"11\" loop=\"true\" url=\"resources/ding.wav\"/\u003e\r\n    \u003cresource mime=\"audio/wav\" id=\"12\" pitch=\"1.0\" loop=\"true\" attenuationDist=\"3.0\" url=\"resources/riff01.wav\"/\u003e\r\n    \u003cresource mime=\"audio/wav\" id=\"13\" pitch=\"1.0\" loop=\"true\" url=\"resources/river.wav\"/\u003e\r\n\r\n    \u003ccontainer                 id=\"20\" name=\"box\" shape=\"3\" sound=\"12\"/\u003e\r\n    \u003ccontainer                 id=\"21\" name=\"ufo\" shape=\"5\" sound=\"13\"/\u003e\r\n\r\n  \u003c/resources\u003e\r\n\r\n  \u003c!-- scene and simulation initialization --\u003e\r\n  \u003cscene id=\"0\" script=\"main\"\u003e\r\n    \u003cobject id=\"0\" name=\"observer\" script=\"camera.lua\" input=\"window\"/\u003e\r\n    \u003cobject id=\"1\" shape=\"1\" surface=\"2\" pos=\"0 0 0\"/\u003e\r\n    \u003cobject id=\"3\" shape=\"20\" sound=\"20\" pos=\"-5 5 0 225 0 0\"/\u003e\r\n    \u003cobject id=\"5\" shape=\"21\" sound=\"21\" pos=\"2 2 2\" speed=\"0 2 0 30 0 0\"/\u003e\r\n    \u003cobject id=\"6\" shape=\"6\" pos=\"0 7 5\"/\u003e\r\n    \u003cobject id=\"7\" shape=\"7\" pos=\"-4.5 4.5 1.7\"/\u003e\r\n    \u003cobject id=\"11\" sound=\"11\" pos=\"10 -10 0\"/\u003e\r\n\r\n    \u003clight id=\"0\" enabled=\"1\" position=\"-.5 -.75 1.0 0.0\" ambient=\"0.3 0.3 0.3 1.0\" diffuse=\"0.7 0.7 0.7 1.0\" specular=\"1.0 1.0 1.0 1.0\"/\u003e\r\n  \u003c/scene\u003e\r\n\r\n\u003c/XperiML\u003e\r\n]]\r\n\r\nlocal xlua, err = xml.decode(cxml)\r\nlog_dump(\"luaxml decode xml: {}, err:{}\", xlua, err)\r\nlocal exml = xml.encode(xlua)\r\nlog_dump(\"luaxml encode xml:{}\", exml)\r\n\r\nlocal xxlua = xml.decode(cxml)\r\nlocal ok = xml.save(\"./bb.xml\", xxlua, \"1.0\", \"gbk\")\r\nlog_dump(\"luaxml save xml:{}\", ok)\r\nlocal flua, ferr = xml.open(\"./bb.xml\")\r\nlog_dump(\"luaxml open xml: {}, err:{}\", flua, ferr)\r\n\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiyoo0812%2Fluaxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiyoo0812%2Fluaxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiyoo0812%2Fluaxml/lists"}