日期:2014-05-17 浏览次数:20499 次
返回结果的方法 private static string GetExceptionPoint(XmlNode node) { XmlDocument xmldoc = new XmlDocument(); XmlElement root = xmldoc.CreateElement("root"); XmlElement el; for (int i = 0; i < node.ChildNodes.Count; i++) { el = xmldoc.CreateElement("item"); el.SetAttribute("label", GetLabelName(node.ChildNodes[i].Attributes["label"].Value)//调用下面的方法); if (node.ChildNodes[i].Attributes["outside"] != null) el.SetAttribute("val", "超厚"); else el.SetAttribute("val", node.ChildNodes[i].Attributes["val"].Value.Split(',')[0]); root.AppendChild(el); } return root.InnerXml; } //重新设置节点的名称和值 private static string GetLabelName(string str) { string[] labs = "L,M,D,LA,E,LB,F,LC,G,H,I,RC,J,RB,K,RA,N".Split(','); string[] names = "右前翼子板,引擎盖,左前翼子板,左A柱,左前门,左B柱,左后门,左C柱,左后翼子板,行李箱盖,右后翼子板,右C柱,右后门,右B柱,右前门,右A柱,车顶".Split(','); for (int i = 0; i < labs.Length; i++) { if (str == labs[i]) return names[i]; } return ""; }
<p class="name"><span class="dance">右前翼子板:</span><span>[color=#FF0000]lab[/color]</span></p><br /> <p class="name"><span class="dance">引擎盖:</span><span>[color=#FF0000]lab[/color]</span></p><br /> <p class="name"><span class="dance">左前翼子板:</span><span>lab</span></p><br /> <p class="name"><span class="dance">左A柱:</span><span>lab</span></p><br /> <p class="name"><span class="dance">左前门:</span><span>lab</span></p><br /> <p class="name"><span class="dance">左B柱:</span><span>lab</span></p><br /> <p class="name"><span class="dance">左后门:</span><span>lab</span></p><br /> <p class="name"><span class="dance">左C柱:</span><span>lab</span></p><br /> <p class="name"><span class="dance">左后翼子板:</span><span>lab</span></p><br /> <p class="name"><span class="dance">行李箱盖:</span><span>lab</span></p><br /> <p class="name"><span class="dance">右后翼盖子板:</span><span>lab</span></p><br /> <p class="name"><span class="dance">右C柱:</span><span>95</span></p><br /> <p class="name"><span class="dance">右后门:</span><span>95</span></p><br /> <p class="name"><span class="dance">左B柱:</span><span>95</span></p><br /> <p class="name"><span class="dance">右前门:</span><span>95</span></p><br /> <p class="name"><span class="dance">右A柱:</span><