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