Commit a84bf492 authored by Peter Eisentraut's avatar Peter Eisentraut

Avoid extra newlines in XML mapping in table forest mode

found by P. Broennimann
parent a36088bc
...@@ -2383,7 +2383,7 @@ xmldata_root_element_start(StringInfo result, const char *eltname, ...@@ -2383,7 +2383,7 @@ xmldata_root_element_start(StringInfo result, const char *eltname,
else else
appendStringInfo(result, " xsi:noNamespaceSchemaLocation=\"#\""); appendStringInfo(result, " xsi:noNamespaceSchemaLocation=\"#\"");
} }
appendStringInfo(result, ">\n\n"); appendStringInfo(result, ">\n");
} }
...@@ -2417,8 +2417,11 @@ query_to_xml_internal(const char *query, char *tablename, ...@@ -2417,8 +2417,11 @@ query_to_xml_internal(const char *query, char *tablename,
errmsg("invalid query"))); errmsg("invalid query")));
if (!tableforest) if (!tableforest)
{
xmldata_root_element_start(result, xmltn, xmlschema, xmldata_root_element_start(result, xmltn, xmlschema,
targetns, top_level); targetns, top_level);
appendStringInfoString(result, "\n");
}
if (xmlschema) if (xmlschema)
appendStringInfo(result, "%s\n\n", xmlschema); appendStringInfo(result, "%s\n\n", xmlschema);
...@@ -2581,6 +2584,7 @@ schema_to_xml_internal(Oid nspid, const char *xmlschema, bool nulls, ...@@ -2581,6 +2584,7 @@ schema_to_xml_internal(Oid nspid, const char *xmlschema, bool nulls,
result = makeStringInfo(); result = makeStringInfo();
xmldata_root_element_start(result, xmlsn, xmlschema, targetns, top_level); xmldata_root_element_start(result, xmlsn, xmlschema, targetns, top_level);
appendStringInfoString(result, "\n");
if (xmlschema) if (xmlschema)
appendStringInfo(result, "%s\n\n", xmlschema); appendStringInfo(result, "%s\n\n", xmlschema);
...@@ -2758,6 +2762,7 @@ database_to_xml_internal(const char *xmlschema, bool nulls, ...@@ -2758,6 +2762,7 @@ database_to_xml_internal(const char *xmlschema, bool nulls,
result = makeStringInfo(); result = makeStringInfo();
xmldata_root_element_start(result, xmlcn, xmlschema, targetns, true); xmldata_root_element_start(result, xmlcn, xmlschema, targetns, true);
appendStringInfoString(result, "\n");
if (xmlschema) if (xmlschema)
appendStringInfo(result, "%s\n\n", xmlschema); appendStringInfo(result, "%s\n\n", xmlschema);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment