KirillOsenkov / XmlParser

A Roslyn-inspired full-fidelity XML parser with no dependencies and a simple Visual Studio XML language service
Apache License 2.0
328 stars 49 forks source link

Equivalent of SyntaxNormalizer #51

Open FrediKats opened 11 months ago

FrediKats commented 11 months ago

Roslyn provides API for normalization whitespaces: https://github.com/dotnet/roslyn/blob/8e4ab418a8f9703f7dfe3a66adc9b3876ef9382f/src/Compilers/CSharp/Portable/Syntax/SyntaxNormalizer.cs#L14

Is this any equivalent of this behavior for XmlParser? My use case:

  1. Parse tree
  2. Add node
  3. Call .NormalizeWhitespace or smth like this
  4. Get Xml with formatter indentations

In source code I found public static class Normalization but look like this normalization works only for attributes.

KirillOsenkov commented 11 months ago

I'm afraid we don't have a formatter currently.