source: TI01-discovery/trunk/ingestAutomation/OAIBatch/oaiProc.py @ 251

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery/trunk/ingestAutomation/OAIBatch/oaiProc.py@2263
Revision 251, 1.1 KB checked in by mguiterr, 15 years ago (diff)

* empty log message *

  • 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"""
5import string, os, sys
6numfilesproc = 0
7
8if len(sys.argv) ==1:                   #if no filenames are specified use current dir
9        filenames = os.listdir(os.curdir)
10else:
11        filenames = sys.argv[1:]
12
13for 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
29print " Procedure validate xml ran to end"
30print "No. of files processed = %s" %numfilesproc
Note: See TracBrowser for help on using the repository browser.