How can I write xml with a namespace and prefix with XElement?

后端 未结 5 1419
北海茫月
北海茫月 2020-12-01 23:31

This may be a beginner xml question, but how can I generate an xml document that looks like the following?



        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 00:15

    For XmlDocument it's similar:

    XmlAttribute attribute1 = sessionXml.CreateAttribute("s", "Attribute1", namespaceURI);
    XmlAttribute attribute2 = sessionXml.CreateAttribute("s", "Attribute2", namespaceURI);
    XmlAttribute attribute3 = sessionXml.CreateAttribute("s", "Attribute3", namespaceURI);
    XmlAttribute attribute4 = sessionXml.CreateAttribute("s", "Attribute4", namespaceURI);
    

提交回复
热议问题