source: Document_handling/trunk/XSLT/ @ 228

Subversion URL:
Revision 228, 842 bytes checked in by selatham, 15 years ago (diff)

Amended for V1.02 of NDB MetadataModel? schema and some extra fields.
New one-off xsls plus scripts to run them.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
1#!/usr/bin/env python
2"""This is a one-off to run siva_oneoff xslt over xml files within given directory structure tree.
3    The output files have same name as input with _D for DIF appended.
5import string, os, sys
6numfilesproc = 0
8if len(sys.argv) ==1:                   #if no filenames are specified use current dir
9        filenames = os.listdir(os.curdir)
11        filenames = sys.argv[1:]
13for filename in filenames:
14        if filename.find('.xml') != -1:
15                outfile=string.split(filename,'.xml')[0] + '_D.xml'
16                commandline = "java org.apache.xalan.xslt.Process -IN %s -XSL siva_oneoff_ndg_to_dif.xsl -OUT %s" %(filename, outfile)
17                print commandline
18                os.system(commandline)
19                numfilesproc += 1
20        else:
21                print 'File %s is not xml format. Not processed'  %filename
23print " Procedure run_siva_oneoff ran to end"
24print "No. of files processed = %s" %numfilesproc
Note: See TracBrowser for help on using the repository browser.