Line | |
---|
1 | #! /usr/bin/perl -w
|
---|
2 |
|
---|
3 | # Written by Dirk Stöcker <openstreetmap@dstoecker.de>
|
---|
4 | # Public domain, no rights reserved.
|
---|
5 |
|
---|
6 | use strict;
|
---|
7 |
|
---|
8 | # This is a simple conversion and in no way a complete XML parser
|
---|
9 | # but it works with a default Perl installation
|
---|
10 |
|
---|
11 | while(my $line = <>)
|
---|
12 | {
|
---|
13 | chomp($line);
|
---|
14 | if($line =~ /<rules\s+name=(".*?")/)
|
---|
15 | {
|
---|
16 | print "tr($1) /* mappaint style named $1 */\n";
|
---|
17 | }
|
---|
18 | elsif($line =~ /colour="([^"]*)#/)
|
---|
19 | {
|
---|
20 | print "tr(\"$1\") /* color $1 */\n";
|
---|
21 | }
|
---|
22 | else
|
---|
23 | {
|
---|
24 | print "/* $line */\n";
|
---|
25 | }
|
---|
26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.