{"id":21378545,"url":"https://github.com/mmaltsev/xml2tree","last_synced_at":"2025-08-01T04:11:43.153Z","repository":{"id":95108925,"uuid":"91954308","full_name":"mmaltsev/Xml2Tree","owner":"mmaltsev","description":"Visualize XML data as a tree.","archived":false,"fork":false,"pushed_at":"2019-05-20T12:56:13.000Z","size":333,"stargazers_count":18,"open_issues_count":2,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-31T06:37:55.250Z","etag":null,"topics":["d3","tree","xml"],"latest_commit_sha":null,"homepage":"https://mmaltsev.github.io/Xml2Tree/","language":"JavaScript","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/mmaltsev.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}},"created_at":"2017-05-21T12:11:15.000Z","updated_at":"2024-08-06T02:19:26.000Z","dependencies_parsed_at":"2023-06-18T23:54:29.572Z","dependency_job_id":null,"html_url":"https://github.com/mmaltsev/Xml2Tree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mmaltsev/Xml2Tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmaltsev%2FXml2Tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmaltsev%2FXml2Tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmaltsev%2FXml2Tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmaltsev%2FXml2Tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmaltsev","download_url":"https://codeload.github.com/mmaltsev/Xml2Tree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmaltsev%2FXml2Tree/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268167486,"owners_count":24206584,"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-08-01T02:00:08.611Z","response_time":67,"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":["d3","tree","xml"],"created_at":"2024-11-22T09:32:17.171Z","updated_at":"2025-08-01T04:11:43.147Z","avatar_url":"https://github.com/mmaltsev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Xml2Tree](https://github.com/mmaltsev/XML2Tree)\n\nXml2Tree is a library for visualizing XML data in the browser as a tree using d3.js.\n\nDemo: https://mmaltsev.github.io/Xml2Tree/\n\nDocs: https://mmaltsev.github.io/Xml2Tree/docs/\n\n## Install\n\n#### Add link to the library:\n```html\n\u003cscript src=\"https://cdn.rawgit.com/mmaltsev/Xml2Tree/master/src/xml2tree.min.js\"\u003e\u003c/script\u003e\n```\n\n#### Create new div element:\n```html\n\u003cdiv class=\"chart1\"\u003e\u003c/div\u003e\n```\n\n#### Call function:\n```html\n\u003cscript\u003e\n  xmltotree(\"chart1\", \"example/example.xml\", [], false, false)\n\u003c/script\u003e\n```\n\n## Options\n\n| Variable         | Type    | Description            |\n| ----------------- | ------- | ---------------------- |\n| elementId        | string  | id of div that contains tree. |\n| filePath         | string  | Path to the XML file. |\n| secondLevelNodes | array of strings   | List of nodes to show on second level of tree. Other will be contained in 'Extra'. If not specified - everything is shown. |\n| isAttributes     | boolean | Whether to show all attributes of elements in XML or not. |\n| isJSON           | boolean | Specified when input file is JSON. |\n\n\n## Examples\nYou can find an XML file that is used below [here](example/example.xml).\n\n#### 1 Example Code:\n```html\n\u003cscript\u003e\n  var elementId = 'chart1';\n  var filePath = 'example/example.xml';\n  var secondLevelNodes = [];\n  var isAttributes = true;\n  var isJSON = false;\n\t\t\n  xml2tree(elementId, filePath, secondLevelNodes, isAttributes, isJSON);\n\u003c/script\u003e\n```\n\n#### 1 Example Result:\n\u003cimg src=\"example/example1.png\" width=\"650\"/\u003e\n\n#### 2 Example Code:\n```html\n\u003cscript\u003e\n  var elementId = 'chart1';\n  var filePath = 'example/example.xml';\n  var secondLevelNodes = ['book'];\n  var isAttributes = false;\n  var isJSON = false;\n\t\t\n  xml2tree(elementId, filePath, secondLevelNodes, isAttributes, isJSON);\n\u003c/script\u003e\n```\n\n#### 2 Example Result:\n\u003cimg src=\"example/example2.png\" width=\"650\"/\u003e\n\n## License.\nMIT License. Copyright (c) 2016-2017 Maxim Maltsev.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmaltsev%2Fxml2tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmaltsev%2Fxml2tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmaltsev%2Fxml2tree/lists"}