add attribute metadata: names and types v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Wed, 09 Jan 2019 00:09:33 +0100
branchv_0
changeset 14 5094a7bf343d
parent 13 816094aa1fff
child 15 26c945ea1733
add attribute metadata: names and types
src/XmlHandler.h
--- a/src/XmlHandler.h	Sun Jan 06 22:15:38 2019 +0100
+++ b/src/XmlHandler.h	Wed Jan 09 00:09:33 2019 +0100
@@ -58,7 +58,7 @@
 		columnCount = 0;
 
 		if (relationCount == 0) {
-			xmlWriter->writeStartElement(L"pipe",{L"xmlns", L"tag:globalcode.info,2018:relpipe"});
+			xmlWriter->writeStartElement(L"relpipe",{L"xmlns", L"tag:globalcode.info,2018:relpipe"});
 		} else {
 			xmlWriter->writeEndElement();
 			xmlWriter->writeEndElement();
@@ -69,6 +69,7 @@
 		xmlWriter->writeTextElement(L"name",{}, name);
 
 
+		xmlWriter->writeStartElement(L"attributes-metadata");
 		columnCount = attributes.size();
 		columnTypes.resize(columnCount);
 		columnTypeCodes.resize(columnCount);
@@ -77,7 +78,12 @@
 			columnNames[i] = attributes[i].getAttributeName();
 			columnTypes[i] = attributes[i].getTypeId();
 			columnTypeCodes[i] = attributes[i].getTypeName();
+			xmlWriter->writeEmptyElement(L"attribute-metadata",{
+				L"name", columnNames[i],
+				L"type", columnTypeCodes[i]
+			});
 		}
+		xmlWriter->writeEndElement();
 
 		// TODO: print attribute metadata
 	}
@@ -90,8 +96,11 @@
 
 		valueCount++;
 
-		// TODO: print attribute metadata (optional)
-		xmlWriter->writeTextElement(L"attribute",{}, value);
+		// TODO: print attribute metadata (only optional, not default)
+		xmlWriter->writeTextElement(L"attribute",{
+			L"name", columnNames[i],
+			L"type", columnTypeCodes[i]
+		}, value);
 
 	}