/// <summary> /// Gets the document. /// </summary> /// <param name="xml">The XML.</param> /// <param name="ns">The ns.</param> /// <returns></returns> public static OpmlDocument GetDocument(string xml, XNamespace ns) { var xd = XDocument.Parse(xml); var opml = OpmlUtility.GetDocument(xd.Root, ns); return(opml); }
/// <summary> /// Gets the document. /// </summary> /// <param name="path">The path.</param> /// <returns></returns> public static OpmlDocument GetDocument(string path) { var xd = XDocument.Load(path); XNamespace ns = xd.Root.GetDefaultNamespace(); if ((ns != null) && !string.IsNullOrEmpty(ns.ToString())) { return(OpmlUtility.GetDocument(xd.Root, ns)); } ns = xd.Root.GetNamespaceOfPrefix(nameof(OpmlUtility.rx)); if (ns == OpmlUtility.rx) { return(OpmlUtility.GetDocument(xd.Root, OpmlUtility.rx)); } return(GetRawDocument(xd)); }