Re: [xsl] Stylesheet works in oXygen fails in Python with Saxonc

Subject: Re: [xsl] Stylesheet works in oXygen fails in Python with Saxonc
From: "dvint@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 21 Jan 2025 23:05:57 -0000
Thanks that did the trick. Didn't realize there were multiple ways to run a stylesheet in against content. I was just following a sample file I found.

..dan

On 2025-01-21 14:09, Martin Honnen martin.honnen@xxxxxx wrote:
On 21/01/2025 23:07, Martin Honnen martin.honnen@xxxxxx wrote:
You seem to have a global variable or parameter that tries to access the
global context item, so far you have only set the initial-match
selection, use e.g.


\xA0 xdm_doc = proc.parse_xml(xml_file_name='nav-short.xml')

and then set both the initial match selection as well as the global
context item to that e.g.

\xA0 executable.set_initial_match_selection(xdm_value=xdm_doc)

\xA0 executable.set_global_context_item(xdm_item=xdm_doc)


Or use
https://www.saxonica.com/saxon-c/doc12/html/saxonc.html#PyXsltExecutable-transform_to_value
e.g.

\xA0 executable_transform_to_value(source_file='nav-short.xml')

Current Thread