There is a link that displays json code, after receiving it, I need to convert to XML format.

The result comes here

var result = "https://launcher.nolosha.fr/api/news/launcher"; 

Next, I try to convert the result to xml

 XmlDocument jsonToXmlNews = JsonConvert.DeserializeXmlNode(result, "NewsItems"); var serverNews = jsonToXmlNews.InnerXml;` 

XML Received Code

 <NewsItems><status>42</status><message>News showed</message><total>3</total><news><title>[INFORMATION] Bug des '3 FPS'</title><date>7/2/2017</date><link>https://forum.nolosha.fr/index.php?threads/information-bug-des-3-fps.4636/#post-28386</link></news><news><title>Compte-rendu de réunion staff - 01/03/2017</title><date>1/3/2017</date><link>https://forum.nolosha.fr/index.php?threads/compte-rendu-de-r%C3%A9union-staff-01-03-2017.5848/unread</link></news><news><title>BÊTA - 1.25</title><date>6/3/2017</date><link>https://forum.nolosha.fr/index.php?threads/bÊta-1-25-maj-14h-launcher.6117/</link></news></NewsItems> 

It is necessary to remove status, message, total from xml, leave only the news array

  • Lay out the code and the error text itself. It is not clear what e.Result.Data is. And it is better to insert json in the description, not a link - Sv__t
  • e.Result.Data is the text that appears when the link loads. Corrected the question ... I only need to pull out the news object - Elizabeth
  • I meant to remove the link and, instead of it, attach the json file itself, so as not to follow the link, and immediately saw the file that you need to get) - Sv__t
  • Updated the question - Elizabeth
  • one
    Wait, then your question is not clear. Do you need to convert JSON to XML, or remove some elements from XML? These are completely different problems. - VladD

0