public static XmlReader XmlReaderFromXmlText(string xml, bool ignoreComments = true) => WrapXmlReader(XmlReader.Create(new StringReader(SerializationUtil.SanitizeXml(xml))), ignoreComments);
public static XDocument XDocumentFromXmlText(string xml) { return(XDocument.Parse(SerializationUtil.SanitizeXml(xml))); }
// [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))))); }
public static Task <XmlReader> XmlReaderFromXmlTextAsync(string xml, bool ignoreComments = true) => Task.FromResult(WrapXmlReader(XmlReader.Create(new StringReader(SerializationUtil.SanitizeXml(xml))), ignoreComments, async: true));