mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-12-18 07:15:32 +00:00
Indexnumber parsing disabled
This commit is contained in:
@@ -1,14 +1,30 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace HaDocument.Models {
|
||||
public class Tradition : HaDocument.Interfaces.ISearchable {
|
||||
public string Index { get; } = "";
|
||||
public class Tradition {
|
||||
public string ID { get; } = "";
|
||||
public string Element { get; } = "";
|
||||
|
||||
public XElement? XElement { get; }
|
||||
|
||||
public Tradition(
|
||||
string index,
|
||||
string element
|
||||
string id,
|
||||
string element,
|
||||
XElement? xelement = null
|
||||
) {
|
||||
Index = index;
|
||||
ID = id;
|
||||
Element = element;
|
||||
XElement = xelement;
|
||||
}
|
||||
|
||||
public static Tradition? FromXElement(XElement element) {
|
||||
if (!element.HasAttributes || element.IsEmpty || element.Name != "letterTradition") return null;
|
||||
if (element.Attribute("letter")?.Value == null) return null;
|
||||
return new Tradition(
|
||||
element.Attribute("letter")!.Value,
|
||||
element.ToString(),
|
||||
element
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user