我希望在C#的XML序列化过程中跳过XML文件中空元素的创建。
例如:
例如:
ArrayElements elm = new ArrayElements
{ Items =new string[] "Item1", " ", "Item2", " ", " ", "Items" } };
在序列化期间,应跳过空字符串。
这是我的类:
[Serializable]
public class ArrayElements
{
[XmlElement(IsNullable=false)]
public string[] Items { get; set; }
}