-1

I have this xml file, which is generated by a .net 4.0 web-based application. I can't figure out how to make it human-readable / editable.

Any clue?

<property name="Display_Settings_Settings" value="&lt;AllDisplays&gt;&lt;DD DisplayId=&quot;333&quot; FolderID=&quot;0&quot; OriginalDisplayID=&quot;330&quot; DisplayName=&quot;@ DD screen - big font - horiz&quot; Description=&quot;&quot; UpdatedUserID=&quot;5&quot; UpdatedTime=&quot;06/03/2020 06:37:56&quot; UpdateNotes=&quot;&quot; ImportantUpdate=&quot;0&quot; DisplayTypeName=&quot;&quot; DisplayDefinition=&quot;&amp;lt;property name=&amp;quot;definition&amp;quot; type=&amp;quot;PropertyCollection&amp;quot;&amp;gt;&amp;#xD;&amp;#xA;  &amp;lt;property name=&amp;quot;Name&amp;quot; value=&amp;quot;displaySurface&amp;quot; type=&amp;quot;String&amp;quot; /&amp;gt;&amp;#xD;&amp;#xA;  &amp;lt;property name=&amp;quot;UniqueName&amp;quot; type=&amp;quot;String&amp;quot; /&amp;gt;&amp;#xD;&amp;#xA;  &amp;lt;property name=&amp;quot;Type&amp;quot; type=&amp;quot;String&amp;quot; /&amp;gt;&amp;#xD;&amp;#xA;  &amp;lt;property name=&amp;quot;Top&amp;quot; value=&amp;quot;24&amp;quot; type=&amp;quot;Int&amp;quot; /&amp;gt;&amp;#xD;&amp;#xA;  &amp;lt;property name=&amp;quot;Left&amp;quot; value=&amp;quot;0&amp;quot; type=&amp;quot;Int&amp;quot; /&amp;gt;&amp;#xD;&amp;#xA;  &amp;lt;property name=&amp;quot;Width&amp;quot; value=&amp;quot;1920&amp;quot; type=&amp;quot;Int&amp;quot; /&amp;gt;&amp;#xD;&amp;#xA;  &amp;lt;property name=&amp;quot;Height&amp;quot; value=&amp;quot;1015&amp;quot; type=&amp;quot;Int&amp;quot; /&amp;gt;&amp;#xD;&amp;#xA;  &amp;lt;property name=&amp;quot;Children&amp;quot; type=&amp;quot;PropertyCollection&amp;quot;&amp;gt;&amp;#xD;&amp;#xA;    &amp;lt;property name=&amp;quot;Children&amp;quot; type=&amp;quot;PropertyCollection&amp;quot;&amp;gt;&amp;#xD;&amp;#xA;      &amp;lt;property type=&amp;quot;PropertyCollection&amp;quot;&amp;gt;&amp;#xD;&amp;#xA;
daviddem
  • 9
  • 3

2 Answers2

1

If this is just a one time thing and you're not looking to write code, you can just copy / paste the xml into an online entity decoder:

https://coderstoolbox.net/string/#!encoding=xml&action=decode&charset=us_ascii

Note, I had to run it through twice to remove all the entities (take the output from the first run, and use it as the input for a second run).

Surronie
  • 86
  • 3
  • It worked! Thank you. I had tried the above website before but it did not cross my mind to run it through twice. – daviddem Mar 07 '20 at 03:08
-1

Code was encoded to send in a HTML message. Below is solution

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApplication1
{
    class Program
    {
        const string FILENAME = @"c:\temp\test.xml";
        static void Main(string[] args)
        {
            string xml = File.ReadAllText(FILENAME);

            string decodedXml = System.Net.WebUtility.HtmlDecode(xml);

            XElement content1 = XElement.Parse(decodedXml);

            //easier way with no decoding
            XElement content2 = XElement.Parse(xml);
        }
    }
}
jdweng
  • 33,250
  • 2
  • 15
  • 20