Python lxml: XML Catalog based URI Resolver for “standalone” URIs

defkon

New Member
I am using the Python lxml package to do XSLT transformation, and would like to post-process some data in the HTML output. The post-processing involves looking up files by file name or documents by URL, and then reading them and inserting the content of the file / document, sometimes as is, and sometimes modified in some way.I have set up URI resolution through an XML Catalog for the XSLT processing step (i.e. for the XML input file and the XSLT file). In order to be consistent with that, I'd like to also let these post-processing filenames and URLs go through a URI resolver step before they are inserted.I read through the URI resolver chapter of the lxml tutorial, and also looked at the lxml.etree.Resolver class, but it did not become clear to me how I could do that. my only idea was that a custom resolver would search and process the XML catalog file, but that is such a common operation that I thought that must already exist.-> Is there a way to get a "standalone" URL (i.e. that is not part of an XML parsing or XSLT transformation step) passed through an XML Catalog based URI Resolver, in Python ?Andy
 
Back
Top