Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of partial support for copying media files #483

Closed
wants to merge 1 commit into from

Conversation

fsteimke
Copy link
Contributor

@fsteimke fsteimke commented Mar 4, 2024

This is an suggestion how to support user when they have to copy media files from the DocBook Sources to the HTML Result file structure. I think that support for this would be very helpfull, since the destination file structury may differ from the source file structure. This initial implementation covers only images (DocBook elements that lead to an html:img element) and does not include any documentation in the reference manual.

The idea is that every html:img element gets an additional attribute ghost:sourcefilename with the full path of the original media file in the docbook source file structure. This attribute is kept in all following transformations steps up to, and including, post processing.

The value of img/@src attribute is relative to the HTML file which includes the img element. When we know the $mediaobject-base-output-uri we can resolve the @src attribute against it to get an absolute value. The same should be possible with chunked output, but this is not implemented yet. When there are to absolute file-paths, we can generate copy-instructions, since we know source and destination.

If the function file:copy is available, the copy instructions can be executed. This is the case for users with a licence of SAXON-PE or EE including Users with Oxygen. Otherwise, a file with copy instructions could be generated (this is not implemented, since there is a conflict with the XSpec based test mechanism: Can't do result-document while evaluating as variable.).

In don't expect this PR to be merged into the Stylesheets, because it's incomplete. If you think the basic idea works, I would develop the proposal further.

Greetings, Frank

@fsteimke
Copy link
Contributor Author

revoked

@fsteimke fsteimke closed this Mar 10, 2024
@fsteimke fsteimke deleted the 482-mediaobjects branch March 10, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant