Dim soapEnvelope As XElement = New XElement(soap + "Envelope",
New XAttribute(XNamespace.Xmlns + "soap", soap.NamespaceName),
New XAttribute(soap + "encodingStyle", "http://www.w3.org/2001/12/soap-encoding"),
New XElement(soap + "Body",
New XAttribute("xmlns", "http://www.test.com"),
New XElement("Open",
New XElement("Data",
New XElement("Desc", _dData.Desc),
New XElement("Num", _dData.Num),
New XElement("Ref", _dData.Ref),
New XElement("Mnn", _dData.Mnn),
New XElement("Ftp", _dData.Ftp))
)))
Следующее дает этот вывод:
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Body xmlns="http://www.test.com">
<Open xmlns="">
<Data>
<Desc>testApp</Desc>
<Num>1</Num>
<Ref></Ref>
<Mnn>116</Mnn>
<Ftp></Ftp>
</Data>
</Open>
</soap:Body>
</soap:Envelope>
Вопрос в том, почему <Open>
XElement автоматически получает атрибут xmlns="
"?
Я хочу такой же вывод, но без каких-либо атрибутов XElement <Open>
Любая помощь будет оценена по достоинству.