Hello,
I want to import a XSL transformation into another by name as it is already possible with XQuery modules - a pitty that this doesn't work with XSL transformations imported via expath package. Furthermore I want to restrict file system access in XSL transformations and xqueries. As far as I understand it to do both I need to define a custom URI resolver - Please tell me if there is a better way. Thus my question is: How can I register a central URI resolver to be used by both XSLT and XQuery?
I work with BaseX 8.2.3 and Saxon-HE 9.6.0-6 directly with Context and LocalSession objects in Java.
I've read http://docs.basex.org/wiki/Catalog_Resolver and registered a catalog file via SET CATFILE but it doesn't seem to be used in XSL transformations. I've also tried it with Apache XML resolver in the classpath. For Saxon I tried to register the CatalogResolver explicitly by setting the system property http://saxon.sf.net/feature/uriResolverClass to org.apache.xml.resolver.tools.CatalogResolver and writing a CatalogManager.properties file without effect.
What is missing? Please help!
Best regards, Max
Hi Max,
Sorry for letting you wait.
Thus my question is: How can I register a central URI resolver to be used by both XSLT and XQuery?
There is currently no way to do so, mostly because BaseX and Saxon are simply too different to get this working.
I've read http://docs.basex.org/wiki/Catalog_Resolver and registered a catalog file via SET CATFILE but it doesn't seem to be used in XSL transformations.
True, this only applies to documents that are added to a database.
I've also tried it with Apache XML resolver in the classpath. For Saxon I tried to register the CatalogResolver explicitly by setting the system property http://saxon.sf.net/feature/uriResolverClass to org.apache.xml.resolver.tools.CatalogResolver and writing a CatalogManager.properties file without effect.
Our XSLT Module allows you to specify both the input and stylesheet as a file path, string or XML node [1]. Which option did you go for/have you experimented with all options?
The Java class XsltTransform.java [2] illustrates how the XSLT transformation is currently performed in BaseX. If you are interested, you could try to build a simple, self-contained Java class that transforms your input with Saxon, and we could then integrate the missing pieces in our software.
What do you think? Christian
[1] http://docs.basex.org/wiki/Xslt_Module [2] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/ba...
basex-talk@mailman.uni-konstanz.de