xslTNG
xslTNG copied to clipboard
Support chunk for print media
I admit that this seems to be a rather esoteric configuration, so let me first explain the general idea and use case:
- I'd like to support (at least partially) the copying of media files (see issue #482 )
- I have made an initial implementation, which executes copy instructions when the function
file:copyis available (which is the case, by the way, for users of Oxygen). See PR 483. - Directly executable copy instructions are only possible, if both the source and the destination are known as absolute file paths. That means that i have to resolve every relative URI in ' img/@src` against the base-uri() of the HTML file.
- In case of a regular, non-chunked transformation i don't know the destination of the transformations primary result (the HTML file), so i don't know the base-uri for copy instructions.
- But chunked output can't be done without knowing the base-uri for HTML files, that's the rationale for $chunk-output-base-uri.
- So i am able to generate executable copy instructions only when doing chunked output.
- That is fine for online publishing, but what can i do if i am interested in PDF output?
- Solution: Doing "fake chunking" by setting the parameter $chunk-include to the empty list. I will get only one file at the file path that is the combination of $chunk-output-base-uri and $chunk. And i get executable copy instructions since the base-uri in known.
This works well when i use docbook.xsl for transformation. It does not, however, when i use print.xsl for paged media. The Error message is
Error at char 56 in expression in xsl:variable/@select on line 437 column 45 of chunk-cleanup.xsl:
FORG0002 Base URI {} is not an absolute URI. Found while atomizing the value of parameter
$adjusted-uri in {supplied} on line 647. Found while atomizing the value of variable
$adjusted-uri in {xsl:apply-templates} on line 621
This error is independent of the value of the parameter $chunk-include, it also happens with the default value. I think the reason is that print.xsl has never been tested with the chunk mechanism.
I don't know how to use the XSpec based test mechanism for this special case, so i made a test case in the attached archive. The included shell script should explain how it is to be used. testcase.zip
Greetings, Frank