Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDocument: Cannot identify and manipulate XText nodes without breaking whitespace formatting #110887

Open
SetTrend opened this issue Dec 22, 2024 · 1 comment
Labels
area-System.Xml untriaged New issue has not been triaged by the area owner

Comments

@SetTrend
Copy link

SetTrend commented Dec 22, 2024

Description

.NET Runtime System.Xml.Linq.XDocument Issue

It is not possible to identify and manipulate XText nodes without breaking the original whitespace formatting.

  1. Using XDocument.Parse(String),

    … XText nodes can correctly be identified, but whitespace formatting is broken, i.e., whitespace is unsolicitedly added.

  2. Using XDocument.Parse(String, LoadOptions.PreserveWhitespace),

    … significant XText nodes can not correctly be identified and segregated from insignificant whitespace XText nodes.

Reproduction Steps

See this MRE:

https://github.com/SetTrend/XDocument-MRE

Expected behavior

It should be possible to identify and manipulate significant XText nodes without breaking the original whitespace formatting.

Actual behavior

See MRE.

Configuration

.NET 9.0 on Windows 10x64.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 22, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-xml
See info in area-owners.md if you want to be subscribed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Xml untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant