Skip to content

Just finished my new LINQ to XML explorer – have a try! #113681

Discussion options

You must be logged in to vote

I believe you are confusing stages in the life cycle of a document here:

When persisting an XDocument document object tree, stored in-memory, to a stream, the Microsoft XmlWriter alters the XML content in a way that you are not able to regain the original data from the persisted storage. It's simply like this:

XDocument content  !==  XmlWriter output

Serializing and deserializing documents should be a bijective operation. This is not the case for the Microsoft XmlWriter output. It's altering the document content and, thus, rendering wrong results. That's commonly called a "bug".

Let me give a simple example, explaining a similar (hypothetical) situation:

Given the following code:

File.Wri…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@chrisoverzero
Comment options

@SetTrend
Comment options

@chrisoverzero
Comment options

@SetTrend
Comment options

Answer selected by SetTrend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants