From 44d50b94bd19985bfd7c16e0d91448ad021252da Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Fri, 13 Dec 2024 09:59:48 +1300 Subject: [PATCH] Attempted fix to allow using multi-file XSLT There may be better solutions which provided a better developer experience. But that would require messing with core, so I'm keen to discuss! --- ogc/bblocks/transformers/xslt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogc/bblocks/transformers/xslt.py b/ogc/bblocks/transformers/xslt.py index da93bf6..fab513b 100644 --- a/ogc/bblocks/transformers/xslt.py +++ b/ogc/bblocks/transformers/xslt.py @@ -21,6 +21,6 @@ def __init__(self): super().__init__(['xslt'], default_inputs, default_outputs) def do_transform(self, metadata: TransformMetadata) -> AnyStr | None: - transform = etree.XSLT(etree.XML(metadata.transform_content.encode('utf-8'))) + transform = etree.XSLT(etree.XML(metadata.transform_content.encode('utf-8'), base_url = metadata.metadata.get('url', '').encode('utf-8'))) result = transform(etree.XML(metadata.input_data.encode('utf-8'))) return etree.tostring(result, encoding='utf-8', pretty_print=True, xml_declaration=True).decode('utf-8')