Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
941 views
in Technique[技术] by (71.8m points)

xslt - Hide a topic from PDF output at xsl level

I have a topic, which only contains some metadata (childs of prolog and some custom elements too) of the documentation. The contents of these elements is displayed in headers and footers in the acutal PDF output.

My problem: now the referred topic itself included in the pdf as an empty chapter.

Setting the processing-role to resource-only or filtering the topic does not solve the problem, as the content of the elements is needed in the further steps of the transformation (headers, footerst ect..)

My best guess is to somehow exclude this one topic and the needless page sequence based on its ID with..

.. adding some attributes in a custom xsl template?

.. modification of topic processing?

.. an obvious method that didn’t occur to me?

but I’m a beginner, so a little guidance would be nice.

Currently using: DITA-OT 2.1; Oxygen 17.1; Bookmap spec.; XSL FO based transformations;

Thanks in advance!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Maybe instead of keeping that content inside the topic, you could keep it inside the main DITA Map, maybe using some DITA "data" elements like:

<map>
<title></title>
<topicmeta>
    <data name="d1" value="v1"/>
</topicmeta>

Anyway if you plan to continue with having a separate topic, maybe you can set on that topic an "outputclass='filtered'" attribute and then use Oxygen's Find/Replace in Files to search in the folder "DITA-OT/plugins/org.dita.pdf2" for "bookmap/chapter". You probably need to find the XSLT templates which process DITA "chapter" elements for the table of contents, bookmarks area and for the main document and add a [not(@outputclass='hidden')] condition to them so that they skip that topic.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...