Description
When editing XML files with XmlNotepad and using Auto Format on Save, the representation of empty elements may change between versions.
For example, an empty element originally written as:
may be rewritten as:
Both forms are semantically equivalent XML, so this is not a functional issue. However, it creates unnecessary noise in source control systems such as Git, especially in repositories where XML files are frequently reviewed and compared.
Expected behavior
When Auto Format on Save is enabled, XmlNotepad should preserve a consistent representation of empty elements.
Possible approaches:
-
Preserve the original style already present in the document.
-
Provide a formatting option allowing users to choose between:
- Self-closing tags (
<Tag />)
- Explicit opening/closing tags (
<Tag></Tag>)
-
At minimum, avoid changing the formatting style between XmlNotepad versions.
Actual behavior
After upgrading XmlNotepad, saving an XML document may rewrite empty elements using a different representation than previous versions, generating large diffs with no semantic changes.
Why this matters
In environments where XML files are stored in Git:
- Reviews become harder because diffs contain formatting-only changes.
- Merges may become noisier.
- Upgrading the editor can unexpectedly modify many files.
The formatting style itself is not important; consistency is.
Description
When editing XML files with XmlNotepad and using Auto Format on Save, the representation of empty elements may change between versions.
For example, an empty element originally written as:
may be rewritten as:
Both forms are semantically equivalent XML, so this is not a functional issue. However, it creates unnecessary noise in source control systems such as Git, especially in repositories where XML files are frequently reviewed and compared.
Expected behavior
When Auto Format on Save is enabled, XmlNotepad should preserve a consistent representation of empty elements.
Possible approaches:
Preserve the original style already present in the document.
Provide a formatting option allowing users to choose between:
<Tag />)<Tag></Tag>)At minimum, avoid changing the formatting style between XmlNotepad versions.
Actual behavior
After upgrading XmlNotepad, saving an XML document may rewrite empty elements using a different representation than previous versions, generating large diffs with no semantic changes.
Why this matters
In environments where XML files are stored in Git:
The formatting style itself is not important; consistency is.