summaryrefslogtreecommitdiff
path: root/src/oregano-convert
blob: a6251f367dd0c0330851d527f894e3e48b62d597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl

# Fix the namespace.
while (<>) {
    if (/<schematic/) {
	s/</<ogo:/;
	s/>/ xmlns:ogo="http:\/\/www.dtek.chalmers.se\/~d4hult\/oregano\/v1">/;
	print;
	last;
    }

    if (/<schematic/) {
	print;
	last;
    }

    print;
}

# Add namespace to tags.
while (<>) {
    
    if (/<[a-zA-Z]/) {
	s/</<ogo:/;
    }

    s/<\//<\/ogo:/;
    print;
}