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