|
import sys
|
|
sys.path.append('C:/Program Files/Saxonica/SaxonHEC1.2.1/Saxon.C.API/python-saxon')
|
|
# sys.path.append('C:\Program Files\Saxonica\SaxonHEC1.2.1\Saxon.C.API\python-saxon')
|
|
# import cython
|
|
import os
|
|
import saxonc
|
|
# with saxonc.PySaxonProcessor(license=False) as proc:
|
|
path='S:/Development/SBE/Brian/12072020'
|
|
for fcfilename in os.listdir(path):
|
|
print('-'*25)
|
|
# print(path)
|
|
# print(fcfilename)
|
|
# print(path.join(fcfilename))
|
|
source_file=path+'/'+fcfilename
|
|
# source_file="S:/Development/SBE/Brian/12072020/NJFC249176.xml"
|
|
source_file="S:/QA/Projects2/SBE/xml_comparison/redacted.xml"
|
|
print(source_file)
|
|
# input()
|
|
proc=saxonc.PySaxonProcessor(license=False)
|
|
print('Test Saxon/C on Python')
|
|
print(proc.version)
|
|
xslt30_processor = proc.new_xslt30_processor()
|
|
xslt30_processor.set_property('m','')
|
|
xslt30_processor.set_cwd(".")
|
|
source_file="S:/QA/Projects2/SBE/schematron/source.xml"
|
|
source_file="S:/Development/SBE/Brian/12072020/NJFC249176.xml"
|
|
transform=xslt30_processor.transform_to_string(source_file=source_file,stylesheet_file='S:/QA/Projects2/SBE/schematron/AccountTransfer-runtime-compiled.xsl',output_file='S:/QA/Projects2/SBE/schematron/testresults.xml')
|
|
# dink=xslt30_processor.transform_to_string(source_file=path+'/'+fcfilename,stylesheet_file='S:/QA/Projects2/SBE/schematron/AccountTransfer-runtime-compiled.xsl',output_file='S:/QA/Projects2/SBE/schematron/testresults.xml')
|
|
msg=xslt30_processor.get_xsl_messages()
|
|
print(fcfilename)
|
|
printed=[]
|
|
if msg is not None:
|
|
i=0
|
|
while i <msg.size:
|
|
if str(msg.item_at(i)) not in printed:
|
|
print('\t'+str(msg.item_at(i)))
|
|
printed.append(str(msg.item_at(i)))
|