Yes, this is possible, see How to transform XML with XSLT using Python, or the documentation.
With regards to using multiple XML files, you have several options:
- Use a parameter and set its value to the document URIs you want to load and use the
document
function in XSLT to load multiple input documents
- If you just know the location and it is a directory, some processors allow you to use `document('dir/with/xml/*.xml)'
- If that fails, you can create a URIResolver. How to do that depends on the processor you use.
With regard to your question on creating multiple output documents, this is less easy with XSLT 1.0 (which is typically used with Python), but you can switch to using XSLT 2.0 with Python, though this requires a bit more effort to set up. Once you have this going, you can use xsl:result-document
to create multiple result documents to dynamically calculated locations, if you so prefer.