3
我需要從XmlReader(長篇故事)中獲取完整的Xml字符串。在這個示例代碼中,最後一個變量theXmlString保持爲空。爲什麼它沒有被賦予Xml字符串?爲什麼我的XmlReader會返回一個空字符串?
string xmlConfig = @"<pdfMappings>
<pdfFile formTypeEnum=""Int_UT_Additional_Investment_Form_Ind_And_LE_direct"">
<perspective ngiAdminPerspectiveName=""Investor"">
<fieldMapping fieldName=""topmostsubform[0].Page2[0].first_names[0]"" mapTo=""CurrentInvolvedParty.FirstName""></fieldMapping>
<fieldMapping fieldName=""topmostsubform[0].Page2[0].surname[0]"" mapTo=""CurrentInvolvedParty.LastName""></fieldMapping>
</perspective>
</pdfFile>
</pdfMappings>";
var reader = XmlReader.Create(new StringReader(xmlConfig));
string theXmlString = reader.ReadOuterXml();
就這麼簡單。謝謝rRrRrRr – willem 2012-03-01 12:13:07