Added Upload functionality; still a bit janky in selecting the files to use...

This commit is contained in:
schnulller
2022-06-05 21:04:22 +02:00
parent 0d33dcd4e5
commit b5aae5ddf0
27 changed files with 188456 additions and 40 deletions

View File

@@ -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);
}
}
}