部分xml信息如下
<vertices>
<vertex x="-1.000000e+01" y="-1.000000e+01" z="0.000000e+00"/>
<vertex x="1.000000e+01" y="-1.000000e+01" z="0.000000e+00"/>
<vertex x="0.000000e+00" y="0.000000e+00" z="1.000000e+01"/>
<vertex x="-1.000000e+01" y="1.000000e+01" z="0.000000e+00"/>
<vertex x="1.000000e+01" y="1.000000e+01" z="0.000000e+00"/>
</vertices>
我的代码
XDocument xDoc = XDocument.Load(@"C:\3MF\TEST\3D\3dmodel.model");
XElement rootelement = xDoc.Root; //获取根节点
string value = xDoc.Element("vertices").Attribute("x").Value;
Console.WriteLine(value.ToString());
Console.ReadKey();
错误内容