I'm making some test to use it.
I have the following xml:
<?xml version="1.0"?>
<test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ma>233</ma>
<ma>2333</ma>
</test>
I have this class to deserialize it:
[Serializable]
public class test
{
public string ma { get; set; }
}
It does contains the first element. Now I want both so I try setting an array
[Serializable]
public class test
{
public string[] ma { get; set; }
}
However setting an array I have now 0 result in ma variable, while I at least have the first one when it is not an array.
I found this answer Using XmlSerializer with an array in the root element, but he used another logic... I'd like to keep using [Serializable]