Conditional processing

Bob.Conlin
Posts: 22

Conditional processing

Thu Sep 15, 2011 11:14 pm

Hello,

How do I set up automatic conditional processing? Specifically I want to use the product attribute to control if an element is included or not. What I have so far is a topic that will be reused many times that only needs a couple of <p> elements to be specific for the different ditamaps that reference that topic. I also have another topic with an acronyms table with the rows identified by a product attribute. I succeeded in rendering to PDF by first creating the profiling attributes and then with the condition set in the supporting topics the correct elements rendered when I submitted the ditamap. Then to render the next ditamap I have to manually change the conditional profile in the supporting topics. I suspect there is a way to set the topicref in the ditamap to automate this but I haven’t been able to figure it out. :( I did find http://docs.oasis-open.org/dita/v1.0/ar ... dproc.html on the OASIS site but that didn’t help me. Everything I’ve read says conditional reusable content is a big reason to use DITA. I plan on using a lot more conditional profiles as I build the document set, I just need a better way to implement it.
Radu
Posts: 5213

Re: Conditional processing

Fri Sep 16, 2011 11:52 am

Hi Bob,

Profiling attributes are useful to publish different content data starting from a DITA Map by filtering parts of the source.

I'll start with an example. Our user manual is published using DITA. We have a single DITA Map but with different DITAVAL filter files we can publish it to different contents depending on the product type (we have Oxygen XML Editor, Developer, Author and SVNClient).
We use the "product" attribute to filter entire topic references from the DITA Map like:

Code: Select all

 <topicref href="tasks/installation-instructions-all-platforms.dita"
        product="editor author svnClient diff developer" collection-type="sequence"/>


or elements from inside a topic like:

Code: Select all

 <ph product="author">
<filepath>oxygenAuthor.bat</filepath>
</ph>
<ph product="developer">
<filepath>oxygenDeveloper.bat</filepath>
</ph>


Our editor.ditaval filter (for publishing the Oxygen XML Editor user manual) content look like:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<val>
  <prop action="exclude" att="product" val="editorEclipse"/>
  <prop action="exclude" att="product" val="author"/>
  <prop action="exclude" att="product" val="authorEclipse"/>
  <prop action="exclude" att="product" val="svnClient"/>
  <prop action="exclude" att="product" val="diff"/>
  <prop action="exclude" att="product" val="developer"/>
  <prop action="exclude" att="product" val="developerEclipse"/>
  <prop action="exclude" att="product" val="expertDeveloper"/>
  <!--This will generate content only for Oxygen XML Editor-->
  <prop action="include" att="product" val="editor"/>
</val>


So in our case we decided to use a single map and by using one DITAVAL filter file or another we can produce user manuals for all our products starting from a single DITA Map.

An Oxygen transformation scenario has settings which allow you to specify such a DITAVAL file to be used when publishing or to create and use automatically a DITAVAL file based on the profiling condition set you have currently selected for the DITA Map:

http://www.oxygenxml.com/doc/ug-editor/index.html?q=/doc/ug-editor/topics/dita-map-edit-filters.html

In your case you seem to have more than one DITA Maps.
So from what I understand you have set values to the "product" attribute in order to successfully generate different outputs (depending on the filters) from the first DITA Map.
For the second map, are the values you have set for "product" not applicable? Maybe then you can use another profiling attribute like "audience" and profile the first map with "product" and then second map with "audience".

Maybe if I have understood wrong you can give us more details about the particular use case.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Bob.Conlin
Posts: 22

Re: Conditional processing

Fri Sep 16, 2011 6:31 pm

Thanks for the quick response. Actually I like your solution (a single ditamap for multiple output) better than my plan to create multiple datamaps. The DITAVAL filter file is new to me, I'll research that. I'm not clear on how to implement the DITAVAL in the transformation scenarios but you have definitly started me on the right track.
Radu
Posts: 5213

Re: Conditional processing

Mon Sep 19, 2011 8:56 am

Hi Bob,

The DITA Open Toolkit used by Oxygen to publish DITA content to various output sources uses a filter file with the extension .ditaval to filter elements based on various profiling attribute values:

http://docs.oasis-open.org/dita/v1.1/OS/langspec/common/about-ditaval.html

Oxygen has a new file template for creating such a file.

If you choose to duplicate and edit an Oxygen transformation scenario (like "DITA Map to PDF"), it contains a Filters tab where you can either specify a custom ditaval file or allow Oxygen to automatically generate one for you either by using the current applied condition set or by filling in a table with the attribute names and values which should be excluded.

By the way, we also have some video demonstrations with the DITA support in Oxygen which you might find useful:

http://www.oxygenxml.com/videos.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 2 guests