Example #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="Location">Location of the OPML file</param>
 public OPML(string Location)
 {
     if (string.IsNullOrEmpty(Location))
         throw new ArgumentNullException("Location");
     XmlDocument Document = new XmlDocument();
     Document.Load(Location);
     foreach (XmlNode Children in Document.ChildNodes)
     {
         if (Children.Name.Equals("opml", StringComparison.CurrentCultureIgnoreCase))
         {
             foreach (XmlNode Child in Children.ChildNodes)
             {
                 if (Child.Name.Equals("body", StringComparison.CurrentCultureIgnoreCase))
                 {
                     Body = new Body((XmlElement)Child);
                 }
                 else if (Child.Name.Equals("head", StringComparison.CurrentCultureIgnoreCase))
                 {
                     Head = new Head((XmlElement)Child);
                 }
             }
         }
     }
 }
Example #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="Document">XmlDocument containing the OPML file</param>
 public OPML(XmlDocument Document)
 {
     if (Document == null)
         throw new ArgumentNullException("Document");
     foreach (XmlNode Children in Document.ChildNodes)
     {
         if (Children.Name.Equals("opml", StringComparison.CurrentCultureIgnoreCase))
         {
             foreach (XmlNode Child in Children.ChildNodes)
             {
                 if (Child.Name.Equals("body", StringComparison.CurrentCultureIgnoreCase))
                 {
                     Body = new Body((XmlElement)Child);
                 }
                 else if (Child.Name.Equals("head", StringComparison.CurrentCultureIgnoreCase))
                 {
                     Head = new Head((XmlElement)Child);
                 }
             }
         }
     }
 }