Код: Выделить всё
using System;
using System.Xml.Schema;
using System.Xml.Serialization;
namespace XmlSerializationTest
{
[XmlType(Namespace = "http://www.test.com")]
public class Element
{
[XmlElement]
public int X;
}
[XmlRoot(Namespace = "http://www.test.com")]
public class Root
{
[XmlElement(Form = XmlSchemaForm.Unqualified)]
public Element Element;
}
public static class Program
{
public static void Main(string[] args)
{
var root = new Root { Element = new Element { X = 1 } };
var xmlSerializer = new XmlSerializer(typeof(Root));
xmlSerializer.Serialize(Console.Out, root);
}
}
}
Код: Выделить всё
1
Создается такой тип кода (часть XmlSchemaForm.Unqualified) с помощью инструмента WSCF.blue, и он портит пространства имен.
Подробнее здесь: https://stackoverflow.com/questions/690 ... nqualified
Мобильная версия