Overpass API regression suite coverage (Nova Scotia) / overpass_api/output_formats/output_xml.cc

overpass_api/output_formats/output_xml.cc

319 of 399 instrumented lines run by the suite (79.9%) at 8edf11b0419c (this file on GitHub).

runnever runcolumns: line, executions, queries (click for the queries that run the line)

1/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
2 *
3 * This file is part of Overpass_API.
4 *
5 * Overpass_API is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * Overpass_API is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.
17 */
19#include "../../expat/escape_xml.h"
20#include "../core/settings.h"
21#include "../frontend/basic_formats.h"
22#include "output_xml.h"
25bool Output_XML::write_http_headers()
260{
270 std::cout<<"Content-type: application/osm3s+xml\n";
280 return true;
290}
32void Output_XML::write_payload_header
33 (const std::string& db_dir, const std::string& timestamp, const std::string& area_timestamp)
35490490 q std::cout<<
36490490 q "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<osm version=\"0.6\""
37490490 q " generator=\"Overpass API "<<basic_settings().version<<" "<<basic_settings().source_hash.substr(0, 8)<<"\">\n"
38490490 q "<note>The data included in this document is from www.openstreetmap.org. "
39490490 q "The data is made available under ODbL.</note>\n";
40490490 q std::cout<<"<meta osm_base=\""<<timestamp<<'\"';
41490490 q if (area_timestamp != "")
420 std::cout<<" areas=\""<<area_timestamp<<"\"";
43490490 q std::cout<<"/>\n\n";
47void Output_XML::write_footer()
49490490 q std::cout<<"\n</osm>\n";
53void Output_XML::display_remark(const std::string& text)
540{
550 std::cout<<"<remark> "<<text<<" </remark>\n";
560}
59void Output_XML::display_error(const std::string& text)
600{
610 std::cout<<"<remark> "<<text<<" </remark>\n";
620}
65void Output_XML::print_global_bbox(const Bbox_Double& bbox)
671313 q std::cout<<" <bounds"
681313 q " minlat=\""<<std::fixed<<std::setprecision(7)<<bbox.south<<"\""
691313 q " minlon=\""<<std::fixed<<std::setprecision(7)<<bbox.west<<"\""
701313 q " maxlat=\""<<std::fixed<<std::setprecision(7)<<bbox.north<<"\""
711313 q " maxlon=\""<<std::fixed<<std::setprecision(7)<<bbox.east<<"\""
721313 q "/>\n\n";
76template< typename Id_Type >
77void print_meta_xml(const OSM_Element_Metadata_Skeleton< Id_Type >& meta,
78 const std::map< uint32, std::string >& users)
791414512 q{
801414512 q std::cout<<" version=\""<<meta.version<<"\" timestamp=\""<<iso_string(meta.timestamp)
811414512 q <<"\" changeset=\""<<meta.changeset<<"\" uid=\""<<meta.user_id<<"\"";
821414512 q std::map< uint32, std::string >::const_iterator it = users.find(meta.user_id);
831414512 q if (it != users.end())
841414512 q std::cout<<" user=\""<<escape_xml(it->second)<<"\"";
851414512 q}
88void prepend_action(const Output_Handler::Feature_Action& action, bool allow_delta = true)
893374243462 q{
903374243462 q if (action == Output_Handler::keep)
912224653400 q ;
92114959062 q else if (action == Output_Handler::show_from)
9354 q std::cout<<"<action type=\"show_initial\">\n";
94114958562 q else if (action == Output_Handler::show_to)
959084 q std::cout<<"<action type=\"show_final\">\n";
973374243462 q if (allow_delta)
983374243462 q {
993374243462 q if (action == Output_Handler::modify)
1005083039 q std::cout<<"<action type=\"modify\">\n<old>\n";
1013323413458 q else if (action == Output_Handler::create)
102105995155 q std::cout<<"<action type=\"create\">\n";
1032263462433 q else if (action == Output_Handler::erase || action == Output_Handler::push_away)
1043789632 q std::cout<<"<action type=\"delete\">\n<old>\n";
1053374243462 q }
1063374243462 q}
109void insert_action(const Output_Handler::Feature_Action& action)
1107342742 q{
1117342742 q if (action == Output_Handler::keep)
1120 ;
1137342742 q else if (action == Output_Handler::modify
1147342742 q || action == Output_Handler::erase || action == Output_Handler::push_away)
1157342742 q std::cout<<"</old>\n<new>\n";
1167342742 q}
119void append_action(const Output_Handler::Feature_Action& action, bool is_new = false, bool allow_delta = true)
1203374243462 q{
1213374243462 q if (action == Output_Handler::keep)
1222224653400 q ;
123114959062 q else if (action == Output_Handler::show_from || action == Output_Handler::show_to)
1249134 q std::cout<<"</action>\n";
1263374243462 q if (allow_delta)
1273374243462 q {
1283374243462 q if (action == Output_Handler::modify)
1295083039 q std::cout<<"</new>\n</action>\n";
1303323413458 q else if (action == Output_Handler::create)
131105995155 q std::cout<<"</action>\n";
1322263462433 q else if (action == Output_Handler::erase || action == Output_Handler::push_away)
1333789632 q {
1343789632 q if (is_new)
1352259712 q std::cout<<"</new>\n</action>\n";
1361529920 q else
1371529920 q std::cout<<"</old>\n</action>\n";
1383789632 q }
1393374243462 q }
1403374243462 q}
143void print_tags(const std::vector< std::pair< std::string, std::string > >* tags,
144 Output_Mode mode, bool& inner_tags_printed)
1453425073462 q{
1463425073462 q if ((mode.mode & Output_Mode::TAGS) && tags && !tags->empty())
1471359918441 q {
1481359918441 q if (!inner_tags_printed)
149441072422 q {
150441072422 q std::cout<<">\n";
151441072422 q inner_tags_printed = true;
152441072422 q }
1531359918441 q for (std::vector< std::pair< std::string, std::string > >::const_iterator it = tags->begin();
1547596388441 q it != tags->end(); ++it)
1556236470441 q std::cout<<" <tag k=\""<<escape_xml(it->first)<<"\" v=\""<<escape_xml(it->second)<<"\"/>\n";
1561359918441 q }
1573425073462 q}
160void print_bounds(const Opaque_Geometry& geometry, Output_Mode mode, bool& inner_tags_printed)
1611245081323 q{
1621245081323 q if ((mode.mode & Output_Mode::BOUNDS) && geometry.has_bbox())
163654216 q {
164654216 q if (!inner_tags_printed)
165654216 q {
166654216 q std::cout<<">\n";
167654216 q inner_tags_printed = true;
168654216 q }
169654216 q std::cout<<" <bounds"
170654216 q " minlat=\""<<std::fixed<<std::setprecision(7)<<geometry.south()<<"\""
171654216 q " minlon=\""<<std::fixed<<std::setprecision(7)<<geometry.west()<<"\""
172654216 q " maxlat=\""<<std::fixed<<std::setprecision(7)<<geometry.north()<<"\""
173654216 q " maxlon=\""<<std::fixed<<std::setprecision(7)<<geometry.east()<<"\""
174654216 q "/>\n";
175654216 q }
1761238539323 q else if ((mode.mode & Output_Mode::CENTER) && geometry.has_center())
1773575 q {
1783575 q if (!inner_tags_printed)
1793575 q {
1803575 q std::cout<<">\n";
1813575 q inner_tags_printed = true;
1823575 q }
1833575 q std::cout<<" <center"
1843575 q " lat=\""<<std::fixed<<std::setprecision(7)<<geometry.center_lat()<<"\""
1853575 q " lon=\""<<std::fixed<<std::setprecision(7)<<geometry.center_lon()<<"\""
1863575 q "/>\n";
1873575 q }
1881245081323 q}
191void print_geometry(const Opaque_Geometry& geometry, Output_Mode mode, bool& inner_tags_printed,
192 const std::string& indent)
193372050400 q{
194372050400 q if ((mode.mode & Output_Mode::GEOMETRY) && geometry.has_components())
1950 {
1960 if (!inner_tags_printed)
1970 {
1980 std::cout<<">\n";
1990 inner_tags_printed = true;
2000 }
2010 const std::vector< Opaque_Geometry* >* components = geometry.get_components();
2020 for (std::vector< Opaque_Geometry* >::const_iterator it = components->begin(); it != components->end(); ++it)
2030 {
2040 if (*it)
2050 {
2060 std::cout<<indent<<"<group>\n";
2070 print_geometry(**it, mode, inner_tags_printed, indent + " ");
2080 std::cout<<indent<<"</group>\n";
2090 }
2100 }
2110 }
212372050400 q else if ((mode.mode & Output_Mode::GEOMETRY) && geometry.has_line_geometry())
2130 {
2140 if (!inner_tags_printed)
2150 {
2160 std::cout<<">\n";
2170 inner_tags_printed = true;
2180 }
2190 const std::vector< Point_Double >* line = geometry.get_line_geometry();
2200 for (std::vector< Point_Double >::const_iterator it = line->begin(); it != line->end(); ++it)
2210 std::cout<<indent<<"<vertex"
2220 " lat=\""<<std::fixed<<std::setprecision(7)<<it->lat<<"\""
2230 " lon=\""<<std::fixed<<std::setprecision(7)<<it->lon<<"\""
2240 "/>\n";
2250 }
226372050400 q else if ((mode.mode & Output_Mode::GEOMETRY) && geometry.has_multiline_geometry())
227175901 q {
228175901 q if (!inner_tags_printed)
229175901 q {
230175901 q std::cout<<">\n";
231175901 q inner_tags_printed = true;
232175901 q }
233175901 q const std::vector< std::vector< Point_Double > >* linestrings = geometry.get_multiline_geometry();
234175901 q for (std::vector< std::vector< Point_Double > >::const_iterator iti = linestrings->begin();
235351801 q iti != linestrings->end(); ++iti)
236175901 q {
237175901 q std::cout<<indent<<"<linestring>\n";
238879501 q for (std::vector< Point_Double >::const_iterator it = iti->begin(); it != iti->end(); ++it)
239703601 q std::cout<<indent<<" <vertex"
240703601 q " lat=\""<<std::fixed<<std::setprecision(7)<<it->lat<<"\""
241703601 q " lon=\""<<std::fixed<<std::setprecision(7)<<it->lon<<"\""
242703601 q "/>\n";
243175901 q std::cout<<indent<<"</linestring>\n";
244175901 q }
245175901 q }
246354460400 q else if ((mode.mode & Output_Mode::GEOMETRY) && geometry.has_center())
2470 {
2480 if (!inner_tags_printed)
2490 {
2500 std::cout<<">\n";
2510 inner_tags_printed = true;
2520 }
2530 std::cout<<indent<<"<point"
2540 " lat=\""<<std::fixed<<std::setprecision(7)<<geometry.center_lat()<<"\""
2550 " lon=\""<<std::fixed<<std::setprecision(7)<<geometry.center_lon()<<"\""
2560 "/>\n";
2570 }
258354460400 q else if ((mode.mode & Output_Mode::BOUNDS) && geometry.has_bbox())
2590 {
2600 if (!inner_tags_printed)
2610 {
2620 std::cout<<">\n";
2630 inner_tags_printed = true;
2640 }
2650 std::cout<<" <bounds"
2660 " minlat=\""<<std::fixed<<std::setprecision(7)<<geometry.south()<<"\""
2670 " minlon=\""<<std::fixed<<std::setprecision(7)<<geometry.west()<<"\""
2680 " maxlat=\""<<std::fixed<<std::setprecision(7)<<geometry.north()<<"\""
2690 " maxlon=\""<<std::fixed<<std::setprecision(7)<<geometry.east()<<"\""
2700 "/>\n";
2710 }
272354460400 q else if ((mode.mode & Output_Mode::CENTER) && geometry.has_center())
2730 {
2740 if (!inner_tags_printed)
2750 {
2760 std::cout<<">\n";
2770 inner_tags_printed = true;
2780 }
2790 std::cout<<indent<<"<center"
2800 " lat=\""<<std::fixed<<std::setprecision(7)<<geometry.center_lat()<<"\""
2810 " lon=\""<<std::fixed<<std::setprecision(7)<<geometry.center_lon()<<"\""
2820 "/>\n";
2830 }
284372050400 q}
287void print_members(const Way_Skeleton& skel, const Opaque_Geometry& geometry,
288 Output_Mode mode, bool& inner_tags_printed)
2891100430267 q{
2901100430267 q if ((mode.mode & Output_Mode::NDS) && !skel.nds.empty())
291881916165 q {
292881916165 q if (!inner_tags_printed)
293877597154 q {
294877597154 q std::cout<<">\n";
295877597154 q inner_tags_printed = true;
296877597154 q }
29717217713165 q for (uint i = 0; i < skel.nds.size(); ++i)
29816335797165 q {
29916335797165 q std::cout<<" <nd ref=\""<<skel.nds[i].val()<<"\"";
30016335797165 q if (geometry.has_faithful_way_geometry() && geometry.way_pos_is_valid(i))
301176665 q std::cout<<" lat=\""<<std::fixed<<std::setprecision(7)<<geometry.way_pos_lat(i)
302176665 q <<"\" lon=\""<<std::fixed<<std::setprecision(7)<<geometry.way_pos_lon(i)<<'\"';
30316335797165 q std::cout<<"/>\n";
30416335797165 q }
305881916165 q }
3061100430267 q}
309void print_members(const Relation_Skeleton& skel, const Opaque_Geometry& geometry,
310 const std::map< uint32, std::string >& roles,
311 Output_Mode mode, bool& inner_tags_printed)
312144651170 q{
313144651170 q if ((mode.mode & Output_Mode::MEMBERS) && !skel.members.empty())
314117067113 q {
315117067113 q if (!inner_tags_printed)
316114487103 q {
317114487103 q std::cout<<">\n";
318114487103 q inner_tags_printed = true;
319114487103 q }
3202328235113 q for (uint i = 0; i < skel.members.size(); ++i)
3212211168113 q {
3222211168113 q std::map< uint32, std::string >::const_iterator it = roles.find(skel.members[i].role);
3232211168113 q std::cout<<" <member type=\""<<member_type_name(skel.members[i].type)
3242211168113 q <<"\" ref=\""<<skel.members[i].ref.val()
3252211168113 q <<"\" role=\""<<escape_xml(it != roles.end() ? it->second : "???")<<"\"";
3272211168113 q if (skel.members[i].type == Relation_Entry::NODE)
3288649082 q {
3298649082 q if (geometry.has_faithful_relation_geometry() && geometry.relation_pos_is_valid(i))
33021464 q std::cout<<" lat=\""<<std::fixed<<std::setprecision(7)<<geometry.relation_pos_lat(i)
33121464 q <<"\" lon=\""<<std::fixed<<std::setprecision(7)<<geometry.relation_pos_lon(i)<<'\"';
3328649082 q std::cout<<"/>\n";
3338649082 q }
3342124678111 q else if (skel.members[i].type == Relation_Entry::WAY)
3352102990111 q {
3362102990111 q if (!geometry.has_faithful_relation_geometry())
3372086386103 q std::cout<<"/>\n";
338166048 q else
339166048 q {
340166048 q bool has_some_geometry = false;
3417090098 q for (uint j = 0; j < geometry.relation_way_size(i); ++j)
3426924056 q has_some_geometry |= geometry.relation_pos_is_valid(i, j);
344166048 q if (!has_some_geometry)
34514565 q std::cout<<"/>\n";
346151486 q else
347151486 q {
348151486 q std::cout<<">\n";
3497075536 q for (uint j = 0; j < geometry.relation_way_size(i); ++j)
3506924056 q {
3516924056 q if (geometry.relation_pos_is_valid(i, j))
3526924056 q std::cout<<" <nd lat=\""<<std::fixed<<std::setprecision(7)<<geometry.relation_pos_lat(i, j)
3536924056 q <<"\" lon=\""<<std::fixed<<std::setprecision(7)<<geometry.relation_pos_lon(i, j)<<"\"/>\n";
3540 else
3550 std::cout<<" <nd/>\n";
3566924056 q }
357151486 q std::cout<<" </member>\n";
358151486 q }
359166048 q }
3602102990111 q }
3612168847 q else
3622168847 q std::cout<<"/>\n";
3632211168113 q }
364117067113 q }
365144651170 q}
368void print_node(const Node_Skeleton& skel,
369 const Opaque_Geometry& geometry,
370 const std::vector< std::pair< std::string, std::string > >* tags,
371 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* meta,
372 const std::map< uint32, std::string >* users,
373 Output_Mode mode)
3741807942233 q{
3751807942233 q std::cout<<" <node";
3761807942233 q if (mode.mode & Output_Mode::ID)
3771807940233 q std::cout<<" id=\""<<skel.id.val()<<'\"';
3781807942233 q if ((mode.mode & (Output_Mode::COORDS | Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
3791807942233 q && geometry.has_center())
380933401132 q std::cout<<" lat=\""<<std::fixed<<std::setprecision(7)<<geometry.center_lat()
381933401132 q <<"\" lon=\""<<std::fixed<<std::setprecision(7)<<geometry.center_lon()<<'\"';
3821807942233 q if ((mode.mode & (Output_Mode::VERSION | Output_Mode::META)) && meta && users)
383136827 q print_meta_xml(*meta, *users);
3851807942233 q bool inner_tags_printed = false;
3861807942233 q print_tags(tags, mode, inner_tags_printed);
3871807942233 q if (!inner_tags_printed)
3881694397227 q std::cout<<"/>\n";
38911354593 q else
39011354593 q std::cout<<" </node>\n";
3911807942233 q}
394void print_way(const Way_Skeleton& skel,
395 const Opaque_Geometry& geometry,
396 const std::vector< std::pair< std::string, std::string > >* tags,
397 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* meta,
398 const std::map< uint32, std::string >* users,
399 Output_Mode mode)
4001100430267 q{
4011100430267 q std::cout<<" <way";
4021100430267 q if (mode.mode & Output_Mode::ID)
4031098936267 q std::cout<<" id=\""<<skel.id.val()<<'\"';
4041100430267 q if ((mode.mode & (Output_Mode::VERSION | Output_Mode::META)) && meta && users)
4054268 q print_meta_xml(*meta, *users);
4071100430267 q bool inner_tags_printed = false;
4081100430267 q print_bounds(geometry, mode, inner_tags_printed);
4091100430267 q print_members(skel, geometry, mode, inner_tags_printed);
4101100430267 q print_tags(tags, mode, inner_tags_printed);
4111100430267 q if (!inner_tags_printed)
412218514248 q std::cout<<"/>\n";
413881916165 q else
414881916165 q std::cout<<" </way>\n";
4151100430267 q}
418void print_relation(const Relation_Skeleton& skel,
419 const Opaque_Geometry& geometry,
420 const std::vector< std::pair< std::string, std::string > >* tags,
421 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* meta,
422 const std::map< uint32, std::string >* roles,
423 const std::map< uint32, std::string >* users,
424 Output_Mode mode)
425144651170 q{
426144651170 q std::cout<<" <relation";
427144651170 q if (mode.mode & Output_Mode::ID)
428144618169 q std::cout<<" id=\""<<skel.id.val()<<'\"';
429144651170 q if ((mode.mode & (Output_Mode::VERSION | Output_Mode::META)) && meta && users)
430274 q print_meta_xml(*meta, *users);
432144651170 q bool inner_tags_printed = false;
433144651170 q print_bounds(geometry, mode, inner_tags_printed);
434144651170 q if (roles)
435144651170 q print_members(skel, geometry, *roles, mode, inner_tags_printed);
436144651170 q print_tags(tags, mode, inner_tags_printed);
437144651170 q if (!inner_tags_printed)
43827572145 q std::cout<<"/>\n";
439117079113 q else
440117079113 q std::cout<<" </relation>\n";
441144651170 q}
444template< typename Id_Type >
445void print_deleted(const std::string& type_name, const Id_Type& id,
446 const Output_Handler::Feature_Action& action,
447 const OSM_Element_Metadata_Skeleton< Id_Type >* meta,
448 const std::map< uint32, std::string >* users,
449 Output_Mode mode)
4502259712 q{
4512259712 q std::cout<<" <"<<type_name;
4522259712 q if (mode.mode & Output_Mode::ID)
4532259712 q std::cout<<" id=\""<<id.val()<<'\"';
4542259712 q if (action == Output_Handler::erase)
4552251312 q std::cout<<" visible=\"false\"";
456845 q else
457845 q std::cout<<" visible=\"true\"";
4582259712 q if ((mode.mode & (Output_Mode::VERSION | Output_Mode::META)) && meta && users)
459102 q print_meta_xml(*meta, *users);
4602259712 q std::cout<<"/>\n";
4612259712 q}
464void Output_XML::print_item(const Node_Skeleton& skel,
465 const Opaque_Geometry& geometry,
466 const std::vector< std::pair< std::string, std::string > >* tags,
467 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* meta,
468 const std::map< uint32, std::string >* users,
469 Output_Mode mode,
470 const Feature_Action& action,
471 const Node_Skeleton* new_skel,
472 const Opaque_Geometry* new_geometry,
473 const std::vector< std::pair< std::string, std::string > >* new_tags,
474 const OSM_Element_Metadata_Skeleton< Node::Id_Type >* new_meta)
4751761476233 q{
4761761476233 q prepend_action(action);
4781761476233 q print_node(skel, geometry, tags, meta, users, mode);
4801761476233 q if (new_skel)
4816778722 q {
4826778722 q insert_action(action);
4846778722 q if (action == Output_Handler::erase || action == Output_Handler::push_away)
485213218 q print_deleted("node", new_skel->id, action, new_meta, users, mode);
4864646620 q else
4874646620 q print_node(*new_skel, *new_geometry, new_tags, new_meta, users, mode);
4886778722 q }
4901761476233 q append_action(action, new_skel);
4911761476233 q}
494void Output_XML::print_item(const Way_Skeleton& skel,
495 const Opaque_Geometry& geometry,
496 const std::vector< std::pair< std::string, std::string > >* tags,
497 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* meta,
498 const std::map< uint32, std::string >* users,
499 Output_Mode mode,
500 const Feature_Action& action,
501 const Way_Skeleton* new_skel,
502 const Opaque_Geometry* new_geometry,
503 const std::vector< std::pair< std::string, std::string > >* new_tags,
504 const OSM_Element_Metadata_Skeleton< Way::Id_Type >* new_meta)
5051096270267 q{
5061096270267 q prepend_action(action);
5081096270267 q print_way(skel, geometry, tags, meta, users, mode);
5101096270267 q if (new_skel)
511543629 q {
512543629 q insert_action(action);
514543629 q if (action == Output_Handler::erase || action == Output_Handler::push_away)
51512768 q print_deleted("way", new_skel->id, action, new_meta, users, mode);
516416026 q else
517416026 q print_way(*new_skel, *new_geometry, new_tags, new_meta, users, mode);
518543629 q }
5201096270267 q append_action(action, new_skel);
5211096270267 q}
524void Output_XML::print_item(const Relation_Skeleton& skel,
525 const Opaque_Geometry& geometry,
526 const std::vector< std::pair< std::string, std::string > >* tags,
527 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* meta,
528 const std::map< uint32, std::string >* roles,
529 const std::map< uint32, std::string >* users,
530 Output_Mode mode,
531 const Feature_Action& action,
532 const Relation_Skeleton* new_skel,
533 const Opaque_Geometry* new_geometry,
534 const std::vector< std::pair< std::string, std::string > >* new_tags,
535 const OSM_Element_Metadata_Skeleton< Relation::Id_Type >* new_meta)
536144447170 q{
537144447170 q prepend_action(action);
539144447170 q print_relation(skel, geometry, tags, meta, roles, users, mode);
541144447170 q if (new_skel)
54220415 q {
54320415 q insert_action(action);
54520415 q if (action == Output_Handler::erase || action == Output_Handler::push_away)
5460 print_deleted("relation", new_skel->id, action, new_meta, users, mode);
54720415 q else
54820415 q print_relation(*new_skel, *new_geometry, new_tags, new_meta, roles, users, mode);
54920415 q }
551144447170 q append_action(action, new_skel);
552144447170 q}
555void Output_XML::print_item(const Derived_Skeleton& skel,
556 const Opaque_Geometry& geometry,
557 const std::vector< std::pair< std::string, std::string > >* tags,
558 Output_Mode mode,
559 const Feature_Action& action)
560372050400 q{
561372050400 q prepend_action(action, true);
563372050400 q std::cout<<" <"<<skel.type_name;
564372050400 q if (mode.mode & Output_Mode::ID)
565372049400 q std::cout<<" id=\""<<skel.id.val()<<'\"';
567372050400 q bool inner_tags_printed = false;
568372050400 q print_geometry(geometry, mode, inner_tags_printed, " ");
569372050400 q print_tags(tags, mode, inner_tags_printed);
570372050400 q if (!inner_tags_printed)
57126945145 q std::cout<<"/>\n";
572345105398 q else
573345105398 q std::cout<<" </"<<skel.type_name<<">\n";
575372050400 q append_action(action, false, true);
576372050400 q}