开发者

How can I make a docbook/xep transform fail when it refers to missing images?

开发者 https://www.devze.com 2023-03-13 10:22 出处:网络
We\'re using docbook (and xep) to produce a large number of documents in both pdf and html form. As part of a refactoring, we want to make our automated build process for these documents more robust.

We're using docbook (and xep) to produce a large number of documents in both pdf and html form.

As part of a refactoring, we want to make our automated build process for these documents more robust. One way to do this is to have our build fail when the newly created html or pdf开发者_JS百科 documents would contain bad references to imagedata (i.e. references to image files that don't exist.)

Right now, if our docbook source refers to any missing images, our automated build just creates the documents anyway, and the broken image links can go unnoticed for a long time.

Is there an automated way to catch such errors? Some param that I could set in docbook or xep would be nice, but I can't find anything like that.


Docbook Toolkit is mostly pure XSL which works higher level than filesystem calls. Therefore it can not detect missing binary files, especially ones referred via URI. Think about it - it requires a library with a HTTP support that would actually resolve the path and traverse the link and see the contents behind it. Like Martin has said it's best done with a separate tool, I'd probably gather up all the href's from docbook and include them in the build tool. Should the files be missing, the build tool itself will report the as missing.

0

精彩评论

暂无评论...
验证码 换一张
取 消