How to create XmlElement attributes with prefix?

前端 未结 4 1381
不知归路
不知归路 2020-12-06 10:46

I need to be able to define an attribute with a prefix in a xml element.

For instance...


         


        
4条回答
  •  佛祖请我去吃肉
    2020-12-06 11:40

    Try creating the attribute directly and adding it to the element:

    XmlAttribute attr = XmlDocToRef.CreateAttribute("s", "id", "http://niem.gov/niem/structures/2.0");
    attr.InnerText = "ID_Person_01";
    TempElement.Attributes.Append(attr);
    

提交回复
热议问题