Project

Profile

Help

Bug #6381 » main.py

Martin Honnen, 2024-03-31 14:45

 
from saxonche import PySaxonProcessor

with PySaxonProcessor() as saxon_proc:
print(saxon_proc.version)

xpath_processor = saxon_proc.new_xpath_processor()

xpath_processor.set_unprefixed_element_matching_policy(1)

xpath_processor.set_context(file_name='sample1.xml')

print(xpath_processor.evaluate('/root/foo'))

xpath_processor.set_context(file_name='sample2.xml')

print(xpath_processor.evaluate('/root/foo'))
(1-1/4)