救命啊!我想在xml里取某个节点的值,但总是报错,请大家帮忙啊!
这是方法:
private string parseMegeFields(string megeField, string xml, string uniqueID)
{
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml(megeField);
XmlNodeList xnl = xdoc.SelectNodes( "/MergeFields "); //TODO: struct of the xml document
StringBuilder sb = new StringBuilder();
foreach (XmlNode xn in xnl)
{
sb.Append( " <MergeField> ");
sb.Append( " <MRGUNQID> ");
sb.Append(Guid.NewGuid().ToString());
sb.Append( " </MRGUNQID> ");
sb.Append( " <UNQID> ");//TODO: guid in transdetail,but int in megefields.
sb.Append(uniqueID);
sb.Append( " </UNQID> ");
sb.Append( " <MgFldName> ");
sb.Append(xn.SelectSingleNode( "/MergeField/MergeFieldName ").InnerText);
sb.Append( " </MgFldName> ");
sb.Append( " <MgFldData> ");
sb.Append(xn.SelectSingleNode( "/MergeFieldData ").InnerText);
sb.Append( " </MgFldData> ");
sb.Append( " </MergeField> ");
&n