我需要以下代碼的虛擬XML,有if (reader.NodeType == //XmlNodeType.Element && reader.Name.ToLower() == "transmissions") condition so
。如何創建虛擬XML結構?
public BusinessEntities.FileParseResult Parse(string FilePath)
{
FileParseResult _fileParseResult = new FileParseResult();
_fileParseResult.FileParseResultType = FileParseResultType.ValidFileClaim;
Logger.LogMessage(PREPROCESS_FILEPARSER.TRACE_MSG, "****WorkComp.Net : Pre Processor -> Start parsing valid AT XML File *****");
XmlReaderSettings settings = new XmlReaderSettings();
settings.ConformanceLevel = ConformanceLevel.Fragment;
using (XmlReader reader = XmlReader.Create(FilePath, settings))
{
try
{
string tranmissionsattr = string.Empty;
string header = string.Empty;
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element && reader.Name.ToLower() == "transmissions")
{
for (int i = 0; i < reader.AttributeCount; i++)
{
reader.MoveToAttribute(i);
tranmissionsattr = tranmissionsattr + " " + reader.Name + "=\"" + reader.GetAttribute(i) + "\"";
}
reader.MoveToElement();
}
}
}
}
}
'<傳輸/>'? –