added basic start page setup; began rewrite of parser

This commit is contained in:
schnulller
2022-06-14 00:31:52 +02:00
parent 6be85d495b
commit 9e53de8be3
61 changed files with 532745 additions and 661 deletions

View File

@@ -1,7 +1,7 @@
namespace HaDocument.Settings.XMLRoots;
using System.Xml.Linq;
public class CommentRoot : HaWeb.XMLParser.IXMLRoot {
public class CommentRoot : HaDocument.Interfaces.IXMLRoot {
public string Type { get; } = "Register";
public string Prefix { get; } = "register";
public string[] XPathContainer { get; } = { ".//data//kommentare/kommcat", ".//kommentare/kommcat" };
@@ -18,9 +18,9 @@ public class CommentRoot : HaWeb.XMLParser.IXMLRoot {
else return null;
};
public List<(string, string?)>? GenerateFields(XMLRootDocument document) {
return null;
}
// public List<(string, string?)>? GenerateFields(XMLRootDocument document) {
// return null;
// }
public (string?, string?) GenerateIdentificationString(XElement element) {
var kat = element.Attribute("value");
@@ -29,9 +29,9 @@ public class CommentRoot : HaWeb.XMLParser.IXMLRoot {
return (null, null);
}
public bool Replaces(XMLRootDocument doc1, XMLRootDocument doc2) {
return true;
}
// public bool Replaces(XMLRootDocument doc1, XMLRootDocument doc2) {
// return true;
// }
public XElement CreateHamannDocument(XElement element) {
var opus = new XElement("opus");
@@ -41,10 +41,10 @@ public class CommentRoot : HaWeb.XMLParser.IXMLRoot {
return opus;
}
public void MergeIntoFile(XElement file, XMLRootDocument document) {
if (file.Element("kommentare") == null)
file.AddFirst(new XElement("kommentare"));
file.Element("kommentare")!.AddFirst(document.Root);
}
// public void MergeIntoFile(XElement file, XMLRootDocument document) {
// if (file.Element("kommentare") == null)
// file.AddFirst(new XElement("kommentare"));
// file.Element("kommentare")!.AddFirst(document.Root);
// }
}