mathnet-spatial icon indicating copy to clipboard operation
mathnet-spatial copied to clipboard

replace call to obsolete XmlExt by XmlWriteExt

Open rsinnig opened this issue 3 years ago • 2 comments

As discussed in cancelled pull request for fix in obsolete XmExt: Fix of the XML serialization issue (writing without InvariantCulture) by replacing all calls to obsolete extension method XmlExt.WriteAttribute by XmlWriteExt.WriteElement.

rsinnig avatar Jul 29 '20 08:07 rsinnig

Failed test caused by different XML-formatting of obsolete XmlExt.WriteAttribute and new internal XmlWriteExt.WriteElementString While XmlExt.WriteAttribute is writing start tag, value, end tag (no new line and tabs inserted) the XmlWriteExt.WriteElementString is creating nice formatting with newline and tabs as long as XmlWriter is not explicitly configured to omit these.

From my perspective the XmlSerializer test needs to be modified.

rsinnig avatar Jul 30 '20 07:07 rsinnig

The test procedure public static T XmlSerializerRoundTrip<T>(T item, string expected) uses the extension methods from obsolete XmlExt. I would propose to add format provider fixed version of XmlExt.WriteAttribute into XmlWriterExt instead. This should fix the operational serialization issues as well as test procedures.

rsinnig avatar Jul 30 '20 08:07 rsinnig

@rsinnig @JohanLarsson any progress on this?

jkalias avatar Mar 27 '23 20:03 jkalias

No progress

JohanLarsson avatar Mar 28 '23 05:03 JohanLarsson

Is this a legitimate concern/bug? Should we fix this? Apologies, but I am not really sure I understand what the problem is. If yes, can someone else from the team take of it?

jkalias avatar Mar 28 '23 12:03 jkalias

I don't remember either, sorry.

JohanLarsson avatar Mar 28 '23 12:03 JohanLarsson

Ok, fair enough. I propose we give this issue one month time, and if it is not addressed till then, we reject it. Agree? @rsinnig @JohanLarsson

jkalias avatar Mar 28 '23 12:03 jkalias

I think I understand now what the issue is, having worked in #208. I also think that WriteElement is a better approach.

jkalias avatar Mar 29 '23 19:03 jkalias

I have noticed that there is an existing branch open. Can you @JohanLarsson @Jones-Adam please have a look, that my commits in this PR are heading in the right direction?

The serialization branch is quite old, and not actively maintained.

I am trying to unify the XML serialization and data contract tests, it seems like a bit messy at the moment.

jkalias avatar Mar 30 '23 08:03 jkalias