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:
@@ -2,6 +2,7 @@ namespace HaWeb.Settings.XMLRoots;
|
||||
using System.Xml.Linq;
|
||||
using HaWeb.Models;
|
||||
using HaWeb.XMLParser;
|
||||
using System.IO;
|
||||
|
||||
public class DocumentRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
public string Type { get; } = "Brieftext";
|
||||
@@ -38,4 +39,14 @@ public class DocumentRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
return opus;
|
||||
}
|
||||
|
||||
public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
if (file.Element("document") == null)
|
||||
file.AddFirst(new XElement("document"));
|
||||
var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
var root = file.Element("document");
|
||||
foreach (var element in elements) {
|
||||
root!.Add(element);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user