Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
RssCategory.cs
1using System;
2using System.Collections.Generic;
3using System.Xml;
5
6namespace Waher.Content.Rss
7{
11 public class RssCategory
12 {
18 public RssCategory(XmlElement Xml, Uri BaseUri)
19 {
20 if (Xml is null)
21 throw new ArgumentNullException(nameof(Xml));
22
23 List<RssWarning> Warnings = new List<RssWarning>();
24
25 this.Name = Xml.InnerText;
26
27 if (Xml.HasAttribute("url"))
28 {
29 string s = XML.Attribute(Xml, "url");
30 if (Uri.TryCreate(BaseUri, s, out Uri Url))
31 this.Domain = Url;
32 else
33 Warnings.Add(new RssWarning(Xml, "Invalid URI: " + s));
34 }
35 else
36 this.Domain = null;
37
38 this.Warnings = Warnings.ToArray();
39 }
40
44 public RssWarning[] Warnings { get; }
45
49 public Uri Domain { get; } = null;
50
54 public string Name { get; }
55 }
56}
Identifies a categorization taxonomy.
Definition: RssCategory.cs:12
RssCategory(XmlElement Xml, Uri BaseUri)
Identifies a categorization taxonomy.
Definition: RssCategory.cs:18
string Name
Name of category
Definition: RssCategory.cs:54
RssWarning[] Warnings
Any warning messages created during parsing.
Definition: RssCategory.cs:44
Contains a warning message.
Definition: RssWarning.cs:9
Helps with common XML-related tasks.
Definition: XML.cs:19
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition: XML.cs:914