Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用xmlwirter向xml的根元素添加非mespaceschemalocation_Xml_Xsd_Xml Serialization_Xmlserializer - Fatal编程技术网

如何使用xmlwirter向xml的根元素添加非mespaceschemalocation

如何使用xmlwirter向xml的根元素添加非mespaceschemalocation,xml,xsd,xml-serialization,xmlserializer,Xml,Xsd,Xml Serialization,Xmlserializer,我有一个xml序列化对象,我想向根元素添加xsi:noNamespaceSchemaLocation,我正在使用xmlwriter 我希望我的xml像下面的示例一样 假的 由于命名空间为空,因此添加了p1前缀。当我从xml中删除默认名称空间时,它起作用了,现在在我编写分部类时添加了xsi前缀。p1前缀是由于名称空间为空而添加的。当我从xml中删除默认名称空间时,它起作用了,现在当我编写分部类时,xsi前缀被添加

我有一个xml序列化对象,我想向根元素添加xsi:noNamespaceSchemaLocation,我正在使用xmlwriter

我希望我的xml像下面的示例一样


假的

由于命名空间为空,因此添加了p1前缀。当我从xml中删除默认名称空间时,它起作用了,现在在我编写分部类时添加了xsi前缀。

p1前缀是由于名称空间为空而添加的。当我从xml中删除默认名称空间时,它起作用了,现在当我编写分部类时,xsi前缀被添加