Dev2.Data.Util.Scrubber.ScrubXml C# (CSharp) Method

ScrubXml() static private method

static private ScrubXml ( string text ) : string
text string
return string
        static string ScrubXml(string text)
        {
            // Remove all instances of xml declaration:
            //
            //    <?xml version="1.0" encoding="utf-8"?>
            //
            // as this may be in weird places!
            // Regex should be: (\\Q<?\\E).*?(\\Q?>\\E) 
            //

            var result = XmlRegex.Replace(text, "");

            try
            {
                result = RemoveAllNamespaces(XElement.Parse(result)).ToString();
            }
            catch(Exception ex)
            {
                Dev2Logger.Log.Error("Scrubber", ex);
            }

            return result;
        }