Skip to content

Repository files navigation

sortxml

dotnet-core-build dotnet-core-release

sortxml is a command-line utility that sorts and prettifies XML files using the Microsoft XML .NET APIs.

Latest release: https://github.com/kodybrown/sortxml/releases/latest/

Project Layout

  • Program.cs: CLI entry point and XML load/sort/write flow.
  • AppOptions.cs: command-line options and option-derived behavior.
  • PowerCode/: embedded helper utilities for argument binding, output, stdin/stdout, encoding, EOL, indentation, and expansion.
  • SortXML.Tests/: xUnit tests and XML fixtures.
  • Properties/PublishProfiles/: publish profiles.
  • docs/: focused documentation.

Main Capabilities

  • Sort XML nodes and attributes.
  • Prettify XML output.
  • Process one or more files in place.
  • Write to stdout or a separate output file.
  • Read XML from redirected stdin.
  • Preserve or override encoding, line endings, indentation, and XML declaration behavior.
  • Configure case-sensitive or case-insensitive sorting.
  • Put a primary attribute first when sorting attributes.

Quick Start

Show help:

dotnet run --project SortXML.csproj -- -help

Sort a file in place:

dotnet run --project SortXML.csproj -- .\SortXML.Tests\test_files\f.xml

Write sorted XML to a separate file:

dotnet run --project SortXML.csproj -- .\SortXML.Tests\test_files\f.xml -out-file .\out.xml

Core Docs

Development

See DEVELOPMENT.md.

About

a very simple utility that prettifies and sorts xml files.

Topics

Resources

Stars

48 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages