--- a/src/Configuration.h Thu Jan 02 23:31:44 2020 +0100
+++ b/src/Configuration.h Sun Jan 05 01:01:12 2020 +0100
@@ -25,6 +25,31 @@
namespace in {
namespace xmltable {
+enum class Mode {
+ STRING,
+ BOOLEAN,
+ // TODO: support also XML number, when we have a rational or decimal numbers in Relational pipes
+ RAW_XML,
+ LINE_NUMBER,
+ XPATH
+};
+
+class XmlElementSkeleton {
+public:
+ relpipe::writer::string_t name;
+ relpipe::writer::string_t uri;
+ relpipe::writer::string_t prefix;
+
+ XmlElementSkeleton() {
+ }
+
+ XmlElementSkeleton(relpipe::writer::string_t name, relpipe::writer::string_t uri = L"", relpipe::writer::string_t prefix = L"") : name(name), uri(uri), prefix(prefix) {
+ }
+
+ virtual ~XmlElementSkeleton() {
+ }
+};
+
class AttributeRecipe {
public:
@@ -34,6 +59,10 @@
relpipe::writer::string_t name;
relpipe::writer::TypeId type;
relpipe::writer::string_t xpath;
+ Mode mode = Mode::STRING;
+ XmlElementSkeleton rawXmlNodeListWrapper;
+ XmlElementSkeleton rawXmlAttributeWrapper;
+
};
class RelationConfiguration {
@@ -46,7 +75,11 @@
relpipe::writer::boolean_t nameIsXPath = false;
relpipe::writer::string_t xpath;
std::vector<AttributeRecipe> attributes;
-
+
+ // Defaults/templates for AttributeRecipe:
+ Mode mode = Mode::STRING;
+ XmlElementSkeleton rawXmlNodeListWrapper;
+ XmlElementSkeleton rawXmlAttributeWrapper = {L"attribute"};
};
class Configuration {