コード例 #1
0
 public static XmlReader XmlReaderFromXmlText(string xml, bool ignoreComments = true)
 => WrapXmlReader(XmlReader.Create(new StringReader(SerializationUtil.SanitizeXml(xml))), ignoreComments);
コード例 #2
0
 public static XDocument XDocumentFromXmlText(string xml)
 {
     return(XDocument.Parse(SerializationUtil.SanitizeXml(xml)));
 }
コード例 #3
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)))));
        }
コード例 #4
0
 public static Task <XmlReader> XmlReaderFromXmlTextAsync(string xml, bool ignoreComments = true)
 => Task.FromResult(WrapXmlReader(XmlReader.Create(new StringReader(SerializationUtil.SanitizeXml(xml))), ignoreComments, async: true));