# HG changeset patch # User František Kučera # Date 1546988973 -3600 # Node ID 5094a7bf343daa1b070af0df4f0c115859eb816a # Parent 816094aa1fff3aeca04335130e9c31a88b46cf10 add attribute metadata: names and types diff -r 816094aa1fff -r 5094a7bf343d 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); }