| | 1 | | namespace Songhay.Models; |
| | 2 | |
|
| | 3 | | /// <summary> |
| | 4 | | /// Dave Winer, his Outline Processor Markup Language document format |
| | 5 | | /// </summary> |
| | 6 | | /// <remarks> |
| | 7 | | /// “OPML an XML-based format that allows exchange of outline-structured information |
| | 8 | | /// between applications running on different operating systems and environments.” |
| | 9 | | /// http://www.opml.org/about |
| | 10 | | /// </remarks> |
| | 11 | | [Serializable] |
| | 12 | | [XmlRoot(ElementName = "opml", Namespace = "http://songhaysystem.com/schemas/opml.xsd")] |
| | 13 | | [DataContract(Name = "opml")] |
| | 14 | | [JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase, WriteIndented = true)] |
| | 15 | | public class OpmlDocument |
| | 16 | | { |
| | 17 | | /// <summary> |
| | 18 | | /// The rx opml schema URI |
| | 19 | | /// </summary> |
| | 20 | | public const string RxOpmlSchema = "http://songhaysystem.com/schemas/opml.xsd"; |
| | 21 | |
|
| | 22 | | /// <summary> |
| | 23 | | /// Initializes a new instance of the <see cref="OpmlDocument"/> class. |
| | 24 | | /// </summary> |
| 5 | 25 | | public OpmlDocument() |
| 5 | 26 | | { |
| 5 | 27 | | Version = "2.0"; |
| 5 | 28 | | XsiSchemaLocation = RxOpmlSchema + " " + RxOpmlSchema; |
| 5 | 29 | | } |
| | 30 | |
|
| | 31 | | /// <summary> |
| | 32 | | /// Gets or sets the schema location. |
| | 33 | | /// </summary> |
| | 34 | | [XmlAttribute("schemaLocation", Namespace = RxOpmlSchema)] |
| | 35 | | [JsonPropertyName("schemaLocation")] |
| 6 | 36 | | public string? XsiSchemaLocation { get; set; } |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Gets the version. |
| | 40 | | /// </summary> |
| | 41 | | [XmlAttribute(AttributeName = "version")] |
| | 42 | | [JsonPropertyName("version")] |
| 6 | 43 | | public string? Version { get; set; } |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// Gets the OPML head element. |
| | 47 | | /// </summary> |
| | 48 | | [XmlElement(ElementName = "head")] |
| | 49 | | [JsonPropertyName("head")] |
| 9 | 50 | | public OpmlHead? OpmlHead { get; set; } |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// Gets the OPML body element. |
| | 54 | | /// </summary> |
| | 55 | | [XmlElement(ElementName = "body")] |
| | 56 | | [JsonPropertyName("body")] |
| 12 | 57 | | public OpmlBody? OpmlBody { get; set; } |
| | 58 | | } |