I'm writing an ASP.NET Core 7 app and my project now requires me to process an XML file version 1.1.
After searching for a while, I've seen that there is no support from the standard Microsoft libraries, as they only seem to support XML version 1.0.
The alternative, which is to use a third party library, they all seem to be paid solutions.
Is there any free solution (which preferably doesn't require any third party libraries) for being able read an XML version 1.1 in C# (or other)? How can I achieve this?
My sample XML
<?xml version="1.1" encoding="UTF-8"?>
<sample>
<element>Contents of element 1</element>
<element>Contents of element 2</element>
<element>Contents of element 3</element>
</sample>
A fragment of my code to load the XML
XmlReaderSettings settings = new XmlReaderSettings();
// Create an instance of XmlReader to read the XML
XmlReader reader = XmlReader.Create(@"PATHTOMYXML", settings);
// Read the XML line by line
while (reader.Read()) {//This is the line that fails saying that it doesn't recognize the version 1.1
// process the XML
}
// close XmlReader object
reader.Close();
Please, note that changing the version in the XML from 1.1 to 1.0 is not a suitable solution since it contains things from version 1.1.
The two features that appear in my XSD that are from version 1.1 are "assert" and "xSign" These two elements then allow me to check for a condition in the XML (assert) or being able to send a signature in the XML (xSign). Also I need the additional unicode support.
Thanks in advance