{"id":18716691,"url":"https://github.com/maxdz-gmbh/mdz_xml","last_synced_at":"2025-11-10T11:30:17.342Z","repository":{"id":208427031,"uuid":"349396959","full_name":"maxdz-gmbh/mdz_xml","owner":"maxdz-gmbh","description":"Very lightweight, fast and portable ANSI C 89/90 compliant library for parsing XML and building DOM-structure. One of the fastest and tiniest XML Parsers on the Web.","archived":false,"fork":false,"pushed_at":"2024-09-20T13:54:18.000Z","size":195,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T10:33:06.552Z","etag":null,"topics":["c","dom","library","parse","parser","parsing","portable","xml","xml-parser","xml-parsing"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maxdz-gmbh.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.txt","contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-03-19T11:17:45.000Z","updated_at":"2024-09-20T13:54:21.000Z","dependencies_parsed_at":"2024-12-28T11:15:14.869Z","dependency_job_id":null,"html_url":"https://github.com/maxdz-gmbh/mdz_xml","commit_stats":null,"previous_names":["maxdz-gmbh/mdz_xml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdz-gmbh%2Fmdz_xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdz-gmbh%2Fmdz_xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdz-gmbh%2Fmdz_xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdz-gmbh%2Fmdz_xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxdz-gmbh","download_url":"https://codeload.github.com/maxdz-gmbh/mdz_xml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239581798,"owners_count":19662958,"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":["c","dom","library","parse","parser","parsing","portable","xml","xml-parser","xml-parsing"],"created_at":"2024-11-07T13:13:25.669Z","updated_at":"2025-11-10T11:30:17.268Z","avatar_url":"https://github.com/maxdz-gmbh.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"**NOTE:** All 0.x releases are kind of \"alpha-versions\" without expectations of API backward-compatibility.\n\n## Table of Contents\n[mdz_xml Overview](#mdz_xml-Overview)\u003cbr\u003e\n[mdz_xml Advantages](#mdz_xml-Advantages)\u003cbr\u003e\n[Performance Comparison](#performance-comparison)\u003cbr\u003e\n[mdz_xml Usage](#mdz_xml-Usage)\u003cbr\u003e\n[Licensing info](#Licensing-info)\u003cbr\u003e\n\n## mdz_xml Overview\nWiki: [mdz_ansi Wiki]\u003cbr\u003e\nfile: *\"mdz_xml.h\"*\n\nPlease take a look at *\"mdz_xml.h\"* file or [mdz_xml Wiki] site for detailed functions descriptions.\n\n[mdz_xml Wiki]: https://github.com/maxdz-gmbh/mdz_xml/wiki/mdz_xml-overview\n\n[mdz_xml] - is a very lightweight, versatile and speedy C  library for  parsing XML-documents, building DOM-structure and navigating it. The library is developed by [maxdz Software GmbH]. Source code of library is highly-portable, conforms to ANSI C 89/90 Standard.\n\nOnly shared/dynamically loaded libraries (*.so* and *.dll* files with import libraries) are available for evaluation testing purposes. Static libraries are covered by our commercial licenses.\n\n**Linux** binaries are built against Linux Kernel 2.6.18 - and thus should be compatible with Debian (from ver. 4.0), Ubuntu (from ver. 8.04), Fedora (from ver. 9)\n\n**FreeBSD** binaries - may be used from FreeBSD ver. 7.0\n\n**Win32** binaries are built using Visual Studio Platform Toolset \"v90\", thus are compatible with Windows versions from Windows 2000.\u003cbr\u003e\n**Win64** binaries are built using Visual Studio Platform Toolset \"v100\", thus are compatible with Windows versions from Windows XP.\u003cbr\u003e\n\n**Android** x86/armeabi-v7a binaries - may be used from Android API level 16 (\"Jelly Bean\" ver. 4.1.x)\u003cbr\u003e\n**Android** x86_64/arm64-v8a binaries - may be used from Android API level 21 (\"Lollipop\" ver. 5.0)\n\n**macOS** binaries - x86_64, from *MacOS X v10.6.0*\n\n[mdz_xml]: https://github.com/maxdz-gmbh/mdz_xml\n[maxdz Software GmbH]: https://maxdz.com/\n\n## mdz_xml Advantages\n\n**1. High portability:** the whole code conforms to ANSI C 89/90 Standard.\n\n**2. Little dependencies:** basically *mdz_xml* functions are only dependend on standard C-library memory-management/access functions. It means you can use library in your code without any further dependencies except standard platform libraries/APIs.\n\n**3. Very fast:** the parser is ca. 50% faster and needs ca. 40% less memory than pugiXml (which is considered as one of the fastest parsers overall). And is ca. 20 times faster than of \"MSXML\" from Microsoft. Please take a look at comparison tables below [Performance Comparison](#performance-comparison).\n\n**4. Parsing of very large XML-documents:** basically, for 64-bit version the only limitation is your available RAM. Still the parser uses memory very effectively, thus parsing of very large files (we mean 2 GB large and bigger files here) is still possible using mdz_xml with a 50% less RAM-consumption than \"pugiXML\" or \"MSXML\" (which are very memory-effective too).\n\n**5. Parse error position:** you are getting position of invalid (non-parced) character in XML-document if there is parse error.\n\n**6. Flexibility:** you can parse read-only XML-documents. You can parse writable XML-documents even faster and with less memory-consumption than read-only parse. You can parse files - our file reading is very fast too.\n\n**7. Navigation:** you can navigate through XML DOM-structure to collect necessary information from elements/children, attributes or texts.\n\n**8. Control:** you can allow/disallow characters to be parsed in element names, attributes, texts, etc. Parser itself handles \u003c?..?\u003e instructions, \u003c!--...--\u003e comments, and mixed content\n\n## Performance Comparison\n\nPerformance comparison tables give an idea about **mdz_xml** parsing overall performance compared to some well-known C/C++ alternatives.\n\nFollowing tests are executed:\n\n\u003cp\u003e- parsing of ~800 MB large XML file\u003cbr\u003e\nhttp://dumps.wikimedia.your.org/wikidatawiki/20210320/wikidatawiki-20210320-stub-articles6.xml.gz\n\n\u003cp\u003e- parsing of ~1.5 GB large XML file\u003cbr\u003e\nhttp://dumps.wikimedia.your.org/wikidatawiki/20210320/wikidatawiki-20210320-stub-meta-current16.xml.gz\n\n\u003cp\u003e- parsing of ~2.0 GB large XML file\u003cbr\u003e\nhttp://dumps.wikimedia.your.org/enwiki/20210320/enwiki-20210320-stub-meta-current20.xml.gz\n\n\u003cp\u003e- parsing of ~2.7 GB large XML file\u003cbr\u003e\nhttp://dumps.wikimedia.your.org/wikidatawiki/20210320/wikidatawiki-20210320-stub-meta-current18.xml.gz\n\nParsing has been tested on Intel i5-6600 @ 3.30GHz (4 cores/4 threads), 16 GB RAM, Windows 10 (64-bit) OS.\u003cbr\u003e\nBuild using VC++, toolset v100/64bit.\n\n\u003cp\u003e- mdz_xml (ver. 0.1) is used as shared library (dll)\u003cbr\u003e\n- Rapid-XML (latest version 1.13), used from sources\u003cbr\u003e\n- TinyXML-2 (latest version on 23.03.2021), used from sources\u003cbr\u003e\n(only actual parsing time in Parse() function is measured for TinyXML-2)\u003cbr\u003e\n- MSXML 6.0 (6.30.18362.418), used via IXMLDOMDocument interface\u003cbr\u003e\n- pugiXml (latest version on 23.03.2021), used from sources\n\n\u003cp\u003e- times are taken in microseconds using QueryPerformanceCounter() in main execution thread\u003cbr\u003e\n- memory usage is taken after parsing finished, from Task-Manager/Processes tab for concrete process\u003cbr\u003e\n\nRaw parse speed:\n\n| Test  | mdz_xml_\u003cbr\u003eparse() | mdz_xml_\u003cbr\u003eparseWritable() | Rapid-XML|TinyXML-2|MSXML 6.0|pugiXml|\n| :---: | ---:               | ---:                        | ---:       | ---:           | ---:            | ---:    |\n| **800 MB**|                |                             |            |                 |            |          |\n| speed,  μs| 965,468       |**830,137**               |1,686,864     |7,424,695     |12,940,236     |1,243,289 |\n| memory, MB| 2028.4       |**1810.4**                  |4530.5       |5477.5       |3428.5        |3298.5 |\n| **1.5 GB** |             |                           |              |             |                 |   |\n| speed,  μs | 1,686,615   | **1,451,198**           | 2,965,762     |12,958,705    |22,529,768     |2,181,464|\n| memory, MB | 3594.8      | **3214.9**             | 7951.3          | 9601.6      |6095.3        |5806.0   |\n| **2.0 GB** |            |                         |                 |             |              |    |\n| speed,  μs |  2,463,885 | **2,091,761**          |  crash          | crash      | 32,466,422   |3,428,855|\n| memory, MB |   4892.3    | **4367.6**            |              |              |8279.7     |7911.0|\n| **2.7 GB** |            |                       |                  |              |         |     |\n| speed,  μs | 3,148,216| **2,682,474**           | crash           | crash        |43,521,423 |4,124,275|\n| memory, MB | 6403.0  |  **5738.1**              |                 |              |10809.6    |10274.6|\n\n\"Load file - parse - unload data\" test scenario (\"warm\" cache):\n\n| Test\u003cbr\u003espeed, μs  | mdz_xml_\u003cbr\u003eparseFile()\u003cbr\u003ewritable | Rapid-XML|TinyXML-2|MSXML 6.0|pugiXml|\n| :---:              | ---:                    | ---:      | ---:    | ---:    | ---: |\n| **800 MB**         | **1,373,711**          |6,586,134   |9,278,020|16,457,514|1,899,272|\n| **1.5 GB**        |  **2,439,384**          |16,474,472 | 16,493,514| 29,422,628 |3,515,159|\n| **2.0 GB**        | **3,388,064**          |crash | crash| 43,360,017 |5,411,959|\n| **2.7 GB**        | **4,406,550**          |crash | crash| 58,679,884 |9,551,191|\n\n\"Load file - parse - unload data\" test scenario (\"cold\" cache):\n| Test\u003cbr\u003espeed, μs  | mdz_xml_\u003cbr\u003eparseFile()\u003cbr\u003ewritable | Rapid-XML|TinyXML-2|MSXML 6.0|pugiXml|\n| :---:              | ---:                    | ---:      | ---:    | ---:    | ---: |\n| **1.5 GB**         | **4,924,833**          |19,006,339   |20,971,263|31,736,102|6,729,579|\n\n## mdz_xml Usage\n\n**Test license generation:** - in order to get free test-license, please proceed to our Shop page [maxdz Shop] and register an account. After registration you will be able to obtain free 14-days test-licenses for our products using \"Obtain for free\" button. \nTest license data should be used in *mdz_xml_init()* call for library initialization.\n\n**NOTE:** All 0.x releases are kind of \"beta-versions\" and can be used 1) only with test-license (during test period of 14 days, with necessity to re-generate license for the next 14 days test period) and 2) without expectations of interface backward-compatibility.\n\nSeveral usage-scenarios are possible:\n- low-level - raw C interface, using *mdz_xml.h* header file\n- higher-level - using *MdzXml* C++ \"wrapper\" around *mdz_xml.h* functions\n\n[mdz_xml Wiki]: https://github.com/maxdz-gmbh/mdz_xml/wiki/mdz_xml-overview\n[maxdz Shop]: https://maxdz.com/shop.php\n\n#### Code Example (low-level use)\n\n*mdz_xml_init()* with license information should be called for library initialization before any subsequent calls:\n\n```\n#include \u003cmdz_xml.h\u003e\n\nint main(int argc, char* argv[])\n{\n  /* mdz_xml library initialization using license info retrieved after license generation (see \"Test license generation\" above) */\n  \n  mdz_bool bRet = mdz_xml_init(\"\u003cfirst-name-hash\u003e\", \"\u003clast-name-hash\u003e\", \"\u003cemail-hash\u003e\", \"\u003clicense-hash\u003e\");\n  ...\n  \n  mdz_xml_uninit(); /* call for un-initialization of library */\n  \n  return 0;\n}\n```\n\n[mdz_xml_create]: https://github.com/maxdz-gmbh/mdz_xml/wiki/mdz_xml_create\n[mdz_xml_destroy]: https://github.com/maxdz-gmbh/mdz_xml/wiki/mdz_xml_destroy\n\nAfter library initialization call *[mdz_xml_create]*() for xml-parser creation. There should be also symmetric *[mdz_xml_destroy]*() call for every create, otherwise allocated for xml-parser memory remains occupied:\n\n```\n#include \u003cmdz_xml.h\u003e\n\nint main(int argc, char* argv[])\n{\n  /* initialize mdz_xml library */\n  mdz_bool bRet = mdz_xml_init(\"\u003cfirst-name-hash\u003e\", \"\u003clast-name-hash\u003e\", \"\u003cemail-hash\u003e\", \"\u003clicense-hash\u003e\");\n  \n  struct mdz_Xml* pXml = mdz_xml_create(); /* create xml-parser */\n  ...\n  ...\n  /* use pXml */\n  ...\n  ...\n  /* destroy pXml */\n  \n  mdz_xml_destroy(\u0026pXml); /* after this pXml should be NULL */\n  \n  mdz_xml_uninit(); /* un-initialize mdz_xml library */\n\n  ...\n}\n```\n\nUse *mdz_Xml** pointer for parsing text from file:\n\n```\n#include \u003cmdz_xml.h\u003e\n\nint main(int argc, char* argv[])\n{\n  mdz_bool bRet = mdz_xml_init(\"\u003cfirst-name-hash\u003e\", \"\u003clast-name-hash\u003e\", \"\u003cemail-hash\u003e\", \"\u003clicense-hash\u003e\");\n  \n  struct mdz_Xml* pAnsi = mdz_xml_create();\n\n  /* parse file \"test.xml */\n  \n  bRet = mdz_xml_parseFile(pXml, \"test.xml\", mdz_true);\n \n  ...\n  \n  mdz_xml_destroy(\u0026pXml);\n  \n  mdz_xml_uninit();\n  ...\n}\n```\n\n## Licensing info\n\nUse of **mdz_xml** library is regulated by license agreement in *LICENSE.txt*\n\nBasically private non-commercial \"test\" usage is unrestricted. Commercial usage of library (incl. its source code) will be regulated by according license agreement.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxdz-gmbh%2Fmdz_xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxdz-gmbh%2Fmdz_xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxdz-gmbh%2Fmdz_xml/lists"}