source: metadata/trunk/toolkit/xslt/providers2xml.py @ 2052

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
7import sys
8
9print "<providers>"
10
11print
12print "<!-- DO NOT EDIT THIS FILE. It is generated from providers.tab using a Python script. -->"
13print
14
15provList = open(sys.argv[1]).readlines()
16for 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
22print "</providers>"
Note: See TracBrowser for help on using the repository browser.