{"id":25264613,"url":"https://github.com/nattfalk/xml-filter","last_synced_at":"2025-07-07T14:33:42.540Z","repository":{"id":95915710,"uuid":"235095978","full_name":"nattfalk/xml-filter","owner":"nattfalk","description":"Extremly simple .NET Core command-line tool for filtering XML files","archived":false,"fork":false,"pushed_at":"2020-02-11T19:34:29.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T01:41:19.237Z","etag":null,"topics":["command-line-tool","csharp","net-core-3","xml"],"latest_commit_sha":null,"homepage":null,"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/nattfalk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-01-20T12:25:21.000Z","updated_at":"2020-02-11T19:34:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"c662ecff-c5be-4d4d-947a-b8ca5f2b4bce","html_url":"https://github.com/nattfalk/xml-filter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nattfalk/xml-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nattfalk%2Fxml-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nattfalk%2Fxml-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nattfalk%2Fxml-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nattfalk%2Fxml-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nattfalk","download_url":"https://codeload.github.com/nattfalk/xml-filter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nattfalk%2Fxml-filter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264092333,"owners_count":23556273,"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":["command-line-tool","csharp","net-core-3","xml"],"created_at":"2025-02-12T07:40:14.153Z","updated_at":"2025-07-07T14:33:42.516Z","avatar_url":"https://github.com/nattfalk.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xml-filter\n\n![](https://github.com/nattfalk/xml-filter/workflows/.NET%20Core/badge.svg)\n\nSimple .NET Core command-line tool for filtering XML files using XPath\n\n## Prerequisites\n\n- .NET CORE 3\n\n## Installing\n\n```\n\u003e git clone https://github.com/nattfalk/xml-filter.git\n\u003e cd xml-filter\n\u003e dotnet build\n```\n\n## Usage\n\n```\nxml-filter -i [input-file] -x [xpath-filter] [additional options]\n\n  -i, --input       Required. Input XML file\n  -x, --xpath       Required. XPath filter used to filter the elements\n  -o, --output      Output XML file\n  -c, --contents    Displays contents from given number of elements after applied filter\n```\n\n## Examples\n\n### Example 1\n\nApply filter and display number of filtered elements\n\n```\n\u003e xml-filter -i testfiles\\cd_catalog.xml -x /CATALOG/CD[COUNTRY='EU']\n```\n\nResults in\n\n```\nFilter resulted in 5 of totally 26 elements.\n```\n\n### Example 2\n\nApply filter and display contents of first 2 filtered elements\n\n```\n\u003e xml-filter -i testfiles\\cd_catalog.xml -x /CATALOG/CD[COUNTRY='EU'] -c 2\n```\n\nResults in\n\n```xml\nFilter resulted in 5 of totally 26 elements.\n\nDisplaying contents of 2 elements\n---------------------------------\n\u003cCD\u003e\n  \u003cTITLE\u003eEros\u003c/TITLE\u003e\n  \u003cARTIST\u003eEros Ramazzotti\u003c/ARTIST\u003e\n  \u003cCOUNTRY\u003eEU\u003c/COUNTRY\u003e\n  \u003cCOMPANY\u003eBMG\u003c/COMPANY\u003e\n  \u003cPRICE\u003e9.90\u003c/PRICE\u003e\n  \u003cYEAR\u003e1997\u003c/YEAR\u003e\n\u003c/CD\u003e\n\u003cCD\u003e\n  \u003cTITLE\u003eRomanza\u003c/TITLE\u003e\n  \u003cARTIST\u003eAndrea Bocelli\u003c/ARTIST\u003e\n  \u003cCOUNTRY\u003eEU\u003c/COUNTRY\u003e\n  \u003cCOMPANY\u003ePolydor\u003c/COMPANY\u003e\n  \u003cPRICE\u003e10.80\u003c/PRICE\u003e\n  \u003cYEAR\u003e1996\u003c/YEAR\u003e\n\u003c/CD\u003e\n```\n\n### Example 3\n\nApply filter and save the filtered elements to file\n\n```\n\u003e xml-filter -i testfiles\\cd_catalog.xml -o result.xml -x /CATALOG/CD[COUNTRY='EU']\n```\n\nResults in\n\n```\nFilter resulted in 5 of totally 26 elements.\n'test.xml' saved!\n```\n\n## Authors\n\n- **Michael Nattfalk** (michaelnattfalk@gmail.com)\n\n## License\n\n[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnattfalk%2Fxml-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnattfalk%2Fxml-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnattfalk%2Fxml-filter/lists"}