Created
July 4, 2024 10:33
-
-
Save martin-honnen/19b65ff0c0096d6a1ea5a48dd386c636 to your computer and use it in GitHub Desktop.
SaxonCHE 12.5 XQuery against XML inputsample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from saxonche import PySaxonProcessor | |
| with PySaxonProcessor() as saxon_proc: | |
| print(saxon_proc.version) | |
| xdm_node = saxon_proc.parse_xml(xml_file_name='sample1.xml') | |
| xquery_proc = saxon_proc.new_xquery_processor() | |
| result = xquery_proc.run_query_to_value(input_xdm_item=xdm_node, query_text='//item => sort()') | |
| print(result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <root> | |
| <item>b</item> | |
| <item>c</item> | |
| <item>a</item> | |
| </root> |
Author
martin-honnen
commented
Jul 4, 2024

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment