简体   繁体   中英

Convert xml string to XML document in Internet Explorer - C#, ASP.NET

I have converted a table as an xml string that looks something like

  <NewDataSet>\r\n <officelist>\r\n <OfficeID>2176</OfficeID>\r\n 
<Office>My Office </Office>\r\n <Region>Toronto</Region>\r\n 
<Division>TO </Division>\r\n 

How do I get this to a strict xml page where you can open and close the nodes (in IE) – like this xml feed

将Response.ContentType更改为“ text / xml”

I found the solution I just used loadxml to load the string. Somehow i forgot about this

doc.LoadXml(xmlDS);
        doc.Save(Response.OutputStream);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM