source: subversion/applications/utils/map-feature-ref/mapfeatures.xslfo.pl @ 29923

Last change on this file since 29923 was 15898, checked in by sward, 10 years ago

Remove debugging messages

File size: 962 bytes
Line 
1#!/usr/bin/perl
2use warnings;
3use strict;
4
5use Geo::OSM::MapFeatures;
6use XML::LibXML;
7
8my $mf = new Geo::OSM::MapFeatures;
9$mf->trace(1);
10$mf->debug_download();
11$mf->parse();
12
13my $doc = XML::LibXML::Document->createDocument();
14my $root = $doc->createElement('mapfeatures');
15$doc->setDocumentElement( $root );
16
17foreach my $section ( $mf->categories() ){
18    my $sectionelem = $root->appendChild( $doc->createElement('section') );
19    $sectionelem->setAttribute('name', $section);
20
21    foreach my $feature ( $mf->features($section) ){
22        my $featureelem = $sectionelem->appendChild( $doc->createElement('feature') );
23        $featureelem->setAttribute('key', $feature->key());
24        next unless $feature->values();
25        foreach my $value ( @{$feature->values()} ){
26            my $valueelem = $featureelem->appendChild( $doc->createElement('value') );
27            $valueelem->setAttribute('name', "$value");
28        }
29    }
30}
31
32print $doc->serialize(1);
Note: See TracBrowser for help on using the repository browser.