Home Forums DITA and XMetaL Discussion Page Preview doesn’t work when there is a conditional attribute in root element Reply To: Page Preview doesn’t work when there is a conditional attribute in root element

Derek Read

Reply to: Page Preview doesn’t work when there is a conditional attribute in root element

It sounds like you want the entire topic to be excluded from output but the file is being included without the root element and is therefore invalid. You should probably see the same issue if you select File > Generate Output for DITA Topic…

Page Preview generates output using the deliverable type you set in Tools > Configure Output… > Preview (tab).

It picks up the last set of conditions you set in the “Show/Hide Conditional Text” dialog you get to when you generate output via File > Generate Output for DITA Topic/Map…

I don't want to say what you are doing is wrong (you may have some other process that handles this), but I would not recommend it if you use maps and the DITA OT to produce output. If you generate output from a map that includes a reference to this topic file and conditionalizing excludes the root element in that topic some deliverables (the DITA OT calls these transtypes) may include the topic in the navigation portion of the output (assuming it has one) while excluding the content from the output. So, for example, in CHM the Contents panel may display the title of your topic, but clicking on it will either take you nowhere, raise an error or display an empty page. This is likely not what you want. But again, you may be feeding this content into another system or a patched version of the DITA OT that does handle this, or producing output to deliverables that do not have this issue, so I cannot say for sure. PDF for one seems to be OK whereas most or all of the HTML-related outputs are not.

Conditionalizing entire topics at the map level (on a element) avoids this issue for all deliverables as far as I know.

To me it also seems cleaner to do this at the map level, but that doesn't mean it will fit with your process or design.

Reply

Products
Downloads
Support