Enable writing ODT files with correct metadata

This commit is contained in:
David Baer
2016-06-30 14:01:55 -04:00
parent e7216708b6
commit 3b185cb32e
17 changed files with 413 additions and 48 deletions

View File

@@ -1,5 +1,6 @@
#include <libxml/tree.h>
#include <string.h>
#include "options.h"
#include "sermon.h"
static xmlNsPtr srmNs = NULL;
@@ -18,8 +19,9 @@ xmlNodePtr
sermonHeader(xmlNsPtr sermon_ns, const Sermon* srm) {
xmlNodePtr header = xmlNewNode(sermon_ns, "header");
appendHeaderNode(sermon_ns, header, "title", srm->sermonTitle);
appendHeaderNode(sermon_ns, header, "author", srm->sermonAuthor);
appendHeaderNode(sermon_ns, header, "author", srm->sermonAuthor ? srm->sermonAuthor : options.authorName);
appendHeaderNode(sermon_ns, header, "occasion", srm->sermonOccasion);
appendHeaderNode(sermon_ns, header, "place", srm->sermonPlace ? srm->sermonPlace : options.placeName);
appendHeaderNode(sermon_ns, header, "date", srm->sermonDate);
appendHeaderNode(sermon_ns, header, "text", srm->sermonText);
return header;
@@ -166,3 +168,4 @@ printXML(xmlDocPtr document) {
xmlOutputBufferPtr output = xmlOutputBufferCreateFd(1, encoding);
xmlSaveFileTo(output, document, "utf-8");
}