Last change
on this file since 2052 was
2052,
checked in by larlam, 12 years ago
|
Updated providers2xml script with warning, id_to_name.xml brought up to date with the other svn.
|
-
Property svn:executable set to
*
|
File size:
697 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | # takes providers.tab and generates an XML mapping from OAI identifier to the title of the provider, to be used in olac2cmdi.xsl |
---|
4 | # argument: the path to providers.tab |
---|
5 | # eg: /home/dietuyt/svn/lat/oai/oai-harvester/trunk/src/main/assembly/resources/providers.csv |
---|
6 | |
---|
7 | import sys |
---|
8 | |
---|
9 | print "<providers>" |
---|
10 | |
---|
11 | print |
---|
12 | print "<!-- DO NOT EDIT THIS FILE. It is generated from providers.tab using a Python script. -->" |
---|
13 | print |
---|
14 | |
---|
15 | provList = open(sys.argv[1]).readlines() |
---|
16 | for line in provList: |
---|
17 | if not "#" in line: |
---|
18 | elements = line.strip().split("\t") |
---|
19 | if len(elements) == 4: |
---|
20 | print "<prov> <identifier>%s</identifier> <name>%s</name> </prov>" % (elements[3], elements[1]) |
---|
21 | |
---|
22 | print "</providers>" |
---|
Note: See
TracBrowser
for help on using the repository browser.