mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 17:25:32 +00:00
Added Upload functionality; still a bit janky in selecting the files to use...
This commit is contained in:
@@ -13,12 +13,12 @@ public class DescriptionsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
return false;
|
||||
};
|
||||
|
||||
public Func<XElement, string?> GetKey { get; } = (elem) => {
|
||||
var index = elem.Attribute("ref");
|
||||
if (index != null && !String.IsNullOrWhiteSpace(index.Value))
|
||||
return index.Value;
|
||||
else return null;
|
||||
};
|
||||
// public Func<XElement, string?> GetKey { get; } = (elem) => {
|
||||
// var index = elem.Attribute("ref");
|
||||
// if (index != null && !String.IsNullOrWhiteSpace(index.Value))
|
||||
// return index.Value;
|
||||
// else return null;
|
||||
// };
|
||||
|
||||
public List<(string, string?)>? GenerateFields(XMLRootDocument document) {
|
||||
return null;
|
||||
@@ -38,4 +38,14 @@ public class DescriptionsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
return opus;
|
||||
}
|
||||
|
||||
public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
if (file.Element("descriptions") == null)
|
||||
file.AddFirst(new XElement("descriptions"));
|
||||
var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
var root = file.Element("descriptions");
|
||||
foreach (var element in elements) {
|
||||
root!.Add(element);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user