Actions
Bug #6381
closedset_unprefixed_element_matching_policy(1) doesn't seem to work
Start date:
2024-03-31
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java
Description
I wrote the following Python code making use of set_unprefixed_element_matching_policy(1)
on an PyXPathProcessor
:
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'))
Output:
SaxonC-HE 12.4.2 from Saxonica
None
None
Sample XML files are attached.
A similar Java program (also attached) outputs:
12.4
<foo xmlns="http://example.com/ns-2023">bar</foo>
<foo xmlns="http://example.com/ns-2023">baz</foo>
<foo xmlns="http://example.com/ns-2024">bar</foo>
<foo xmlns="http://example.com/ns-2024">baz</foo>
I would have expected the Python program to select and output the same nodes as the Java program, instead, despite the policy set, no nodes seem to be selected.
Files
Please register to edit this issue
Actions