{"id":28298213,"url":"https://github.com/nanonid/xmljsonkit","last_synced_at":"2026-05-15T18:04:32.901Z","repository":{"id":57401918,"uuid":"290796671","full_name":"Nanonid/xmljsonkit","owner":"Nanonid","description":"XML to JSON parser library with ordered elements based on Chevrotain","archived":false,"fork":false,"pushed_at":"2020-08-31T18:27:28.000Z","size":133,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T05:14:24.804Z","etag":null,"topics":["json","parser","xml-parse"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nanonid.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":"2020-08-27T14:24:53.000Z","updated_at":"2020-08-31T18:27:30.000Z","dependencies_parsed_at":"2022-09-15T18:40:31.517Z","dependency_job_id":null,"html_url":"https://github.com/Nanonid/xmljsonkit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Nanonid/xmljsonkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nanonid%2Fxmljsonkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nanonid%2Fxmljsonkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nanonid%2Fxmljsonkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nanonid%2Fxmljsonkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nanonid","download_url":"https://codeload.github.com/Nanonid/xmljsonkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nanonid%2Fxmljsonkit/sbom","scorecard":{"id":98843,"data":{"date":"2025-08-11","repo":{"name":"github.com/Nanonid/xmljsonkit","commit":"101a21bae66c09d7eb4a7feacf458ed5ce8cdb84"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"45 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T09:41:47.288Z","repository_id":57401918,"created_at":"2025-08-15T09:41:47.288Z","updated_at":"2025-08-15T09:41:47.288Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281625165,"owners_count":26533338,"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","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"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":["json","parser","xml-parse"],"created_at":"2025-05-23T06:13:28.494Z","updated_at":"2025-10-29T12:46:44.409Z","avatar_url":"https://github.com/Nanonid.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"xmljsonkit\n==\nXML to JSON parser library with ordered elements.\n\n**xmljsonkit** is a XML to JSON parser library that is built on the fast and extensible [Chevrotain](https://sap.github.io/chevrotain/docs/) parser.\n\n**xmljsonkit** is a small extenion of the [Chevrotain Example XML Parser](https://github.com/SAP/chevrotain/tree/master/examples/grammars/xml) with a JSON Concrete Syntax Tree (CST) visitor that can be extended for special XML syntax or JSON handling.\n\nValues that are simple strings will be converted to numbers, if possible.\nThe conversion process is configurable.\n\nSimple string text values will be promoted from objects to string property values for more convinient JSON handling.\n\n```typescript\n  \"\u003cgenre\u003eComputer\u003c/genre\u003e\" =\u003e { genre:\"Computer\" }\n  \"\u003cprice\u003e  44.95  \u003c/price\u003e\" =\u003e { price: 44.95 }\n```\n\nThere are two parsers:\n1. xml2json which does simple JSON object translation.\n2. orderedxml2json which extends xml2json for maintaining order of elements.\n\nThe XML Lexer, Parser, and JSON Visitor are all easily extended or changed to meet your exact JSON translation requirements.\n\nOrdered XML Parsing\n---\n\nSometimes order of elements is critical, for example with the XML represents a graphical format with serialized operations that must be executed in order.\n\nFor example, these shapes or stencils have path commands which must be executed in order. Other **xml2json** libraries do *NOT* maintain order, but **xmljsonkit** orderedxml2json does maintain order.\n\norderedxml2json takes a list of property names that require ordered array handling, and only builds the **__elements** ordered array for that elements contents.\n\n```xml\n\u003cshapes\u003e\n\t\u003cshape name=\"or\" aspect=\"variable\"\u003e\n\t\t\u003cbackground\u003e\n\t\t\t\u003cpath\u003e\n\t\t\t\t\u003cmove x=\"0\" y=\"0\"/\u003e\n\t\t\t\t\u003cquad x1=\"100\" y1=\"0\" x2=\"100\" y2=\"50\"/\u003e\n\t\t\t\t\u003cquad x1=\"100\" y1=\"100\" x2=\"0\" y2=\"100\"/\u003e\n\t\t\t\t\u003cclose/\u003e\n\t\t\t\u003c/path\u003e\n\t\t\u003c/background\u003e\n\t\t\u003cforeground\u003e\n\t\t\t\u003cfillstroke/\u003e\n\t\t\u003c/foreground\u003e\n\t\u003c/shape\u003e\n\u003c/shapes\u003e\n```\nCreates JSON with the correct order in a reserved array property called **__elements**.\n\n```typescript\n    const ORDERD_PROPERTY = \"__elements\";\n    var shapes = result.shapes.shape as any[];\n    var shape = shapes[0];\n    expect(shape._name).toBe(\"or\");\n    expect(shape.background).toBeDefined();\n    expect(shape.background.path).toBeDefined();\n    expect(shape.background.path.__elements).toBeDefined();\n    var path = shape.background.path.__elements as any[];\n    expect(path.length).toBe(4);\n    expect(path[0]).toEqual({move: { _x:0, _y:0}});\n    expect(path[1]).toEqual({quad: { _x1:100, _y1:0, _x2:100, _y2:50}});\n    expect(path[2]).toEqual({quad: { _x1:100, _y1:100, _x2:0, _y2:100}});\n    expect(path[3]).toEqual({close: {}});\n```\n\nEmedded text between elements is also preserved.\n\n```xml\n\u003ccatalog\u003e\n  \u003cbook id=\"bk101\"\u003e\nBefore author\u003cauthor\u003eGambardella, Matthew\u003c/author\u003e\n  \u003ctitle\u003eXML Developer's Guide\u003c/title\u003e\n  \u003cgenre\u003eComputer\u003c/genre\u003e\n  \u003cprice\u003e  44.95  \u003c/price\u003eafter price\u003cpublish_date\u003e2000-10-01\u003c/publish_date\u003e\n  \u003cdescription\u003eAn in-depth look at creating applications\nwith XML.\u003c/description\u003eLast\u003c/book\u003e\n```\nMaintains the correct order of text and XML elements.\n\n```typescript\n    const ORDERD_PROPERTY = \"__elements\";\n    const books = result.catalog.book;\n    expect(books.length).toBe(2);\n    var book = books[0];\n    expect(book._id).toBe(\"bk101\");\n    expect(book.__elements).toBeDefined();\n    var bookProps:any[] = book.__elements;\n    expect(bookProps.length).toBe(9);\n    expect(bookProps[0][\"#text\"]).toBe(\"Before author\");\n    expect(bookProps[1].author).toBe(\"Gambardella, Matthew\");\n    expect(bookProps[4].price).toBe(44.95);\n    expect(bookProps[5][\"#text\"]).toBe(\"after price\");\n    expect(bookProps[6].publish_date).toBe(\"2000-10-01\");\n    expect(bookProps[8][\"#text\"]).toBe(\"Last\");\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanonid%2Fxmljsonkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanonid%2Fxmljsonkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanonid%2Fxmljsonkit/lists"}