mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-30 09:45:32 +00:00
added basic start page setup; began rewrite of parser
This commit is contained in:
@@ -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);
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace HaDocument.Settings.XMLRoots;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class DescriptionsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
public class DescriptionsRoot : HaDocument.Interfaces.IXMLRoot {
|
||||
public string Type { get; } = "Metadaten";
|
||||
public string Prefix { get; } = "metadaten";
|
||||
public string[] XPathContainer { get; } = { ".//data/descriptions", ".//descriptions" };
|
||||
@@ -18,17 +18,17 @@ public class DescriptionsRoot : 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) {
|
||||
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");
|
||||
@@ -36,14 +36,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);
|
||||
}
|
||||
}
|
||||
// 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);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace HaDocument.Settings.XMLRoots;
|
||||
using System.Xml.Linq;
|
||||
|
||||
|
||||
public class DocumentRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
public class DocumentRoot : HaDocument.Interfaces.IXMLRoot {
|
||||
public string Type { get; } = "Brieftext";
|
||||
public string Prefix { get; } = "brieftext";
|
||||
public string[] XPathContainer { get; } = { ".//data/document", ".//document" };
|
||||
@@ -19,17 +19,17 @@ public class DocumentRoot : 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) {
|
||||
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");
|
||||
@@ -37,14 +37,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);
|
||||
}
|
||||
}
|
||||
// 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);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace HaDocument.Settings.XMLRoots;
|
||||
using System.Xml.Linq;
|
||||
|
||||
|
||||
public class EditsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
public class EditsRoot : HaDocument.Interfaces.IXMLRoot {
|
||||
public string Type { get; } = "Texteingriffe";
|
||||
public string Prefix { get; } = "texteingriffe";
|
||||
public string[] XPathContainer { get; } = { ".//data/edits", ".//edits" };
|
||||
@@ -19,17 +19,17 @@ public class EditsRoot : 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) {
|
||||
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");
|
||||
@@ -37,14 +37,14 @@ public class EditsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
return opus;
|
||||
}
|
||||
|
||||
public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
if (file.Element("edits") == null)
|
||||
file.AddFirst(new XElement("edits"));
|
||||
var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
var root = file.Element("edits");
|
||||
foreach (var element in elements) {
|
||||
root!.Add(element);
|
||||
}
|
||||
}
|
||||
// public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
// if (file.Element("edits") == null)
|
||||
// file.AddFirst(new XElement("edits"));
|
||||
// var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
// var root = file.Element("edits");
|
||||
// foreach (var element in elements) {
|
||||
// root!.Add(element);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace HaDocument.Settings.XMLRoots;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class MarginalsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
public class MarginalsRoot : HaDocument.Interfaces.IXMLRoot {
|
||||
public string Type { get; } = "Stellenkommentar";
|
||||
public string Prefix { get; } = "stellenkommentar";
|
||||
public string[] XPathContainer { get; } = { ".//data/marginalien", ".//marginalien" };
|
||||
@@ -18,17 +18,17 @@ public class MarginalsRoot : 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) {
|
||||
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");
|
||||
@@ -36,14 +36,14 @@ public class MarginalsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
return opus;
|
||||
}
|
||||
|
||||
public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
if (file.Element("marginalien") == null)
|
||||
file.AddFirst(new XElement("marginalien"));
|
||||
var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
var root = file.Element("marginalien");
|
||||
foreach (var element in elements) {
|
||||
root!.Add(element);
|
||||
}
|
||||
}
|
||||
// public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
// if (file.Element("marginalien") == null)
|
||||
// file.AddFirst(new XElement("marginalien"));
|
||||
// var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
// var root = file.Element("marginalien");
|
||||
// foreach (var element in elements) {
|
||||
// root!.Add(element);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace HaDocument.Settings.XMLRoots;
|
||||
using System.Xml.Linq;
|
||||
|
||||
|
||||
public class ReferencesRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
public class ReferencesRoot : HaDocument.Interfaces.IXMLRoot {
|
||||
public string Type { get; } = "Personen / Orte";
|
||||
public string Prefix { get; } = "personenorte";
|
||||
public string[] XPathContainer { get; } = { ".//data/definitions", ".//definitions" };
|
||||
@@ -17,17 +17,17 @@ public class ReferencesRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
return elem.Name.ToString();
|
||||
};
|
||||
|
||||
public List<(string, string?)>? GenerateFields(XMLRootDocument document) {
|
||||
return null;
|
||||
}
|
||||
// public List<(string, string?)>? GenerateFields(XMLRootDocument document) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
public (string?, string?) GenerateIdentificationString(XElement element) {
|
||||
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");
|
||||
@@ -35,14 +35,14 @@ public class ReferencesRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
return opus;
|
||||
}
|
||||
|
||||
public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
if (file.Element("definitions") == null)
|
||||
file.AddFirst(new XElement("definitions"));
|
||||
var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
var root = file.Element("definitions");
|
||||
foreach (var element in elements) {
|
||||
root!.Add(element);
|
||||
}
|
||||
}
|
||||
// public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
// if (file.Element("definitions") == null)
|
||||
// file.AddFirst(new XElement("definitions"));
|
||||
// var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
// var root = file.Element("definitions");
|
||||
// foreach (var element in elements) {
|
||||
// root!.Add(element);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace HaDocument.Settings.XMLRoots;
|
||||
using System.Xml.Linq;
|
||||
|
||||
|
||||
public class TraditionsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
public class TraditionsRoot : HaDocument.Interfaces.IXMLRoot {
|
||||
public string Type { get; } = "Überlieferung";
|
||||
public string Prefix { get; } = "ueberlieferung";
|
||||
public string[] XPathContainer { get; } = { ".//data/traditions", ".//traditions" };
|
||||
@@ -19,17 +19,17 @@ public class TraditionsRoot : 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) {
|
||||
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");
|
||||
@@ -37,13 +37,13 @@ public class TraditionsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
return opus;
|
||||
}
|
||||
|
||||
public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
if (file.Element("traditions") == null)
|
||||
file.AddFirst(new XElement("traditions"));
|
||||
var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
var root = file.Element("traditions");
|
||||
foreach (var element in elements) {
|
||||
root!.Add(element);
|
||||
}
|
||||
}
|
||||
// public void MergeIntoFile(XElement file, XMLRootDocument document) {
|
||||
// if (file.Element("traditions") == null)
|
||||
// file.AddFirst(new XElement("traditions"));
|
||||
// var elements = document.Root.Elements().Where(x => IsCollectedObject(x));
|
||||
// var root = file.Element("traditions");
|
||||
// foreach (var element in elements) {
|
||||
// root!.Add(element);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user