我需要将第二行更改为config schema ="xxx.xsd"
我该怎么做?
1<?xml version="1.0" encoding="utf-8"?>
2<**config**>
3<maketool-config>
.
.
.
</maketool-config>
</config>
这是代码:
XElement triggerRoot = new XElement("config",
new XElement("maketool-config",
);
答案 0 :(得分:0)
var doc = new XmlDocument();
var triggerRoot = new XElement("config", new XElement("maketool-config", ""));
var newAttribute = doc.CreateAttribute("schema");
newAttribute.Value = "xxx.xsd";
triggerRoot.SetAttributeValue("schema", "xxx.xsd");