Skip to content

Instantly share code, notes, and snippets.

@martin-honnen
Created July 4, 2024 10:33
Show Gist options
  • Select an option

  • Save martin-honnen/19b65ff0c0096d6a1ea5a48dd386c636 to your computer and use it in GitHub Desktop.

Select an option

Save martin-honnen/19b65ff0c0096d6a1ea5a48dd386c636 to your computer and use it in GitHub Desktop.
SaxonCHE 12.5 XQuery against XML inputsample
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)
<root>
<item>b</item>
<item>c</item>
<item>a</item>
</root>
@martin-honnen
Copy link
Author

PyCharmeProfSaxonCHEIntellisense

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