Feature #5021
closedOption to supply base URI of the source text in SaxonJS.getResource() for Node.js
100%
Description
I am having a case, when I would like to use the base-uri()
function for a resource I resolved with SaxonJS.getResource({text: <source_text>, type: "xml"})
. The reason for that is I need to resolve the links that are relative to the document I resolved using its text, while embedding it into the document I use in SaxonJS.transform()
.
I was trying the following approaches in my attempt to make it work:
- Use
text
andlocation
options together (like it is done inSaxonJS.transform()
) then use a stylesheet parameter to access the resolved document — thetext
option is ignored and the document is resolved using thelocation
option. - Use only
text
option and supply the{"<source_uri>": "<resource_object>"}
indocumentPool
then usedoc($<source_uri>)
to access the document — the document is still fetched by its URI instead of provided resource.
I noticed that when I am using the "location" option, the object is provided with _saxonBaseUri
and _saxonDocUri
options that contain the URI of the resolved document. I tried providing _saxonBaseUri
and _saxonDocUri
directly in the resource I got, and it actually worked!
So, is there a proper way to do what I described in case I am doing it wrong? And if not, then is it possible to provide such option to align the behavior with SaxonJS.transform()
?
Please register to edit this issue
Also available in: Atom PDF Tracking page