public static XDocument XDocumentFromXmlText(string xml)
 {
     return(XDocument.Parse(SerializationUtil.SanitizeXml(xml)));
 }
Esempio n. 2
0
 public static XmlReader XmlReaderFromXmlText(string xml, bool ignoreComments = true)
 => WrapXmlReader(XmlReader.Create(new StringReader(SerializationUtil.SanitizeXml(xml))), ignoreComments);
Esempio n. 3
0
 public static Task <XmlReader> XmlReaderFromXmlTextAsync(string xml, bool ignoreComments = true)
 => Task.FromResult(WrapXmlReader(XmlReader.Create(new StringReader(SerializationUtil.SanitizeXml(xml))), ignoreComments, async: true));
Esempio n. 4
0
        // [WMR 20160421] Note: StringReader, XmlReader and JsonReader don't require explicit disposal
        // JsonTextReader overrides Close method => explicitly dispose

        public static XmlReader XmlReaderFromXmlText(string xml)
        {
            return(WrapXmlReader(XmlReader.Create(new StringReader(SerializationUtil.SanitizeXml(xml)))));
        }