Added Classes for detecting Root Elements of Hamann-Collections

This commit is contained in:
schnulller
2022-06-02 19:26:43 +02:00
parent 2762a5e310
commit 35ce2034f7
20 changed files with 526 additions and 40 deletions

View File

@@ -0,0 +1,31 @@
namespace HaWeb.Settings.XMLRoots;
using System.Xml.Linq;
using HaWeb.XMLParser;
public class ReferencesRoot : HaWeb.XMLParser.IXMLRoot {
public string Type { get; } = "Personen / Orte";
public string Container { get; } = "definitions";
public Predicate<XElement> IsCollectedObject { get; } = (elem) => {
if (elem.Name == "personDefs" || elem.Name == "structureDefs" || elem.Name == "handDefs" || elem.Name == "locationDefs")
return true;
return false;
};
public Func<XElement, string?> GetKey { get; } = (elem) => {
return elem.Name.ToString();
};
public List<(string, string)>? GenerateFields(XMLRootDocument document) {
return null;
}
public (string?, string) GenerateIdentificationString(XElement element) {
return (null, Container);
}
public bool Replaces(XMLRootDocument doc1, XMLRootDocument doc2) {
return true;
}
}