{"id":22208462,"url":"https://github.com/oscarmarcusson/xmltree","last_synced_at":"2026-05-02T13:35:09.950Z","repository":{"id":210389143,"uuid":"724154454","full_name":"OscarMarcusson/XmlTree","owner":"OscarMarcusson","description":"A utility for parsing an XML structure without all the hassle","archived":false,"fork":false,"pushed_at":"2023-12-02T12:19:17.000Z","size":254,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T04:42:57.809Z","etag":null,"topics":["csharp","dotnet","tree-structure","utility-library","xml","xml-parser"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/XmlTree","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/OscarMarcusson.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}},"created_at":"2023-11-27T14:04:09.000Z","updated_at":"2023-12-02T20:42:42.000Z","dependencies_parsed_at":"2023-12-02T13:41:18.804Z","dependency_job_id":null,"html_url":"https://github.com/OscarMarcusson/XmlTree","commit_stats":null,"previous_names":["oscarmarcusson/xmltree"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OscarMarcusson%2FXmlTree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OscarMarcusson%2FXmlTree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OscarMarcusson%2FXmlTree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OscarMarcusson%2FXmlTree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OscarMarcusson","download_url":"https://codeload.github.com/OscarMarcusson/XmlTree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245401372,"owners_count":20609163,"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":["csharp","dotnet","tree-structure","utility-library","xml","xml-parser"],"created_at":"2024-12-02T19:19:36.261Z","updated_at":"2026-05-02T13:35:04.917Z","avatar_url":"https://github.com/OscarMarcusson.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xml Tree\n\nA utility for parsing XML structures without all the hassle. \n\n```csharp\n// Parse files\nvar doc = XmlTree.Parse.File(\"c:/dir/my-file.xml\");\nforeach(var rootNode in doc.nodes) {\n    // Do something\n}\n```\n\n```csharp\n// Parse strings\nvar doc = XmlTree.Parse.String(\"\u003cp\u003e Hello World! \u003c/p\u003e\");\nConsole.WriteLine(doc.nodes[0].tag); // \u003e p\nConsole.WriteLine(doc.nodes[0].value); // \u003e Hello World!\n```\n\n```csharp\n// Include or ignore comments\nvar options = new XmlTree.ParserOptions { comments = CommentOptions.Include };\nvar doc = XmlTree.Parse.String(\"\u003c!-- Comments work! --\u003e\", options);\nConsole.WriteLine(doc.nodes[0].tag); // \u003e !--\nConsole.WriteLine(doc.nodes[0].value); // \u003e Comments work!\n```\n\n### What you get\n\n* A full node tree of any given XML structure\n\n* Options for getting / ignoring comments\n\n* Full attribute support\n  \n  * With quotation marks, both `value=\"example\"` and `value='example'`\n  \n  * Without quotation marks, like `value=example`\n\n* Full self-closing support\n  \n  * Any `\u003cx /\u003e` style element will be parsed correctly no matter the type of xml\n  \n  * Any self closing tags in HTML docs, like `\u003cimg /\u003e`, will be parsed correctly even if supplied as `\u003cimg\u003e`\n  \n  * Optional custom closing tags in the parse options\n\n* Simple value \u0026 text handling\n  \n  * Single value nodes, like a `\u003cp\u003e` element without any spans in HTML, will be parsed as a single node containing the text as its node value\n  \n  * Multi-value nodes, like a `\u003cp\u003e` element with one or more `\u003cspan\u003e` children, will have all content as child nodes. Any free text outside of spans will be places as children without an element tag \n\n* Automatic encoding from the prolog for `File` and `Byte` parsing\n\n#### Note\n\nThis is **not** a deserialization utility, although it could be turned into one should you wish. This is a tool for getting the tree structure of XML data. The tool was for example built for creating an HTML minifier, but it may be used in any XML related workflow.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarmarcusson%2Fxmltree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foscarmarcusson%2Fxmltree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscarmarcusson%2Fxmltree/lists"}