Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery/trunk/ingestAutomation/OAIBatch/retired/oaiProc.py@3779
Revision 3779,
1.1 KB
checked in by selatham, 13 years ago
(diff) |
retiring some old code
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | """This is a one-off to run Add_dif_xsd_statement xslt over xml files within given directory structure tree. |
---|
3 | The output files have same name as input with _new appended. |
---|
4 | """ |
---|
5 | import string, os, sys |
---|
6 | numfilesproc = 0 |
---|
7 | |
---|
8 | if len(sys.argv) ==1: #if no filenames are specified use current dir |
---|
9 | filenames = os.listdir(os.curdir) |
---|
10 | else: |
---|
11 | filenames = sys.argv[1:] |
---|
12 | |
---|
13 | for filename in filenames: |
---|
14 | if filename.find('.xml') != -1: |
---|
15 | #outfile=string.split(filename,'.xml')[0] + '_new.xml' |
---|
16 | outfile='./out/'+filename |
---|
17 | #commandline = "java org.apache.xalan.xslt.Process -IN %s -XSL Michael_burek_dif_oneoff.xsl -OUT %s" %(filename, outfile) |
---|
18 | #commandline = "java -jar Validate.jar -xsdss ndgB1.02.01.xsd %s" %(filename) |
---|
19 | #commandLine = "java -jar oai_Pro.jar %s " %(filename) |
---|
20 | #commandline = "java -jar removeNS.jar %s " %(filename) |
---|
21 | commandline = "java -jar oai_Proc.jar %s " %(filename) |
---|
22 | |
---|
23 | print commandline |
---|
24 | os.system(commandline) |
---|
25 | numfilesproc += 1 |
---|
26 | else: |
---|
27 | print 'File %s is not xml format. Not processed' %filename |
---|
28 | |
---|
29 | print " Procedure validate xml ran to end" |
---|
30 | print "No. of files processed = %s" %numfilesproc |
---|
Note: See
TracBrowser
for help on using the repository browser.