Created
October 19, 2023 18:22
-
-
Save martin-honnen/f0c75239c6e9b823a560f4ca1bc19472 to your computer and use it in GitHub Desktop.
collection-uri and base-uri test
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
| <doc>First test XML instance.</doc> |
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
| <doc>Second test XML instance.</doc> |
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
| <doc>Third test XML instance.</doc> |
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
| import saxonche | |
| with saxonche.PySaxonProcessor(license=False) as proc: | |
| print(proc.version) | |
| xsltproc = proc.new_xslt30_processor() | |
| executable = xsltproc.compile_stylesheet(stylesheet_file="document-uri-test1.xsl") | |
| content = executable.call_template_returning_string() | |
| print(f"\ncontent:\n{content}") |
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
| <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" expand-text="yes"> | |
| <xsl:output indent="yes" omit-xml-declaration="yes"/> | |
| <xsl:template name="xsl:initial-template"> | |
| <xsl:for-each select="collection('?select=*.(xml|XML)&content-type=application/xml')"> | |
| <debug-message>Processing document-uri "{document-uri()}"...base-uri "{base-uri()}"</debug-message> | |
| <xsl:copy-of select="."/> | |
| </xsl:for-each> | |
| </xsl:template> | |
| </xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment