I’m trying to run an XSLT transform that works from the file system to work when run from BaseX, where the input is a document in a database.
The transform needs to resolve URI references from the input source to their targets in the same database.
It looks like using base-uri() in XSLT returns a file:/ URL:
["+ [DEBUG] resolveTopicRef(): base-uri($context)="file:///utah/bundle-devops-enterprise-dev-ops.ditamap""]
["+ [DEBUG] df:resolveTopicRef(): context is a topicref."]
["+ [DEBUG] df:resolveTopicRef(): href=""now-keys-common.ditamap"""]
["+ [DEBUG] df:resolveTopicRef(): topicUri is a string, trying to resolve..."]
["+ [DEBUG] $context = ", <mapref href="now-keys-common.ditamap"/>]
["+ [DEBUG] baseuri(context) =
file:///utah/bundle-devops-enterprise-dev-ops.ditamap"]
["+ [DEBUG] df:resolveTopicRef(): document at uri ""file:/utah/now-keys-common.ditamap"" is not available, returning empty list"]
(This is the output of xslt:transform-report()?messages, which is very nice BTW)
So my question is: Is it possible, short of using the BaseX REST API, to have a Saxon-run XSLT access docs from a database? I can easily set the @xml:base attribute on the input document before passing it to Saxon if there was some base
URI that would then resolve from the database.
I didn’t see anything relevant in the documentation for the XSLT module.
In this case the transform is doing DITA map resolution, creating a single result document from a tree of DITA maps by resolving <mapref> elements to their referenced maps and replacing the reference with the referenced element.
I haven’t figured out an efficient way to do this directly in XQuery, so I thought I’d apply my existing XSLT transform, but this seems to be a blocker.
I’m sure it would work to use the BaseX REST API to access the docs from the XSLT, but that of course requires having a running server and HTTP handler. I was hoping this would just work.
Thanks,
E.
_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
LinkedIn | Twase\itter | YouTube | Facebook