excluding content from transform question, product attribute

Post here questions and problems related to editing and publishing DITA content.
protl
Posts: 13
Joined: Mon Dec 18, 2017 10:52 pm

excluding content from transform question, product attribute

Post by protl »

My Oxygen product includes content shared by 30 different products. I use "product" attributes to identify content that should appear only in transforms for specific products. In some cases, I put more than one product value in the attribute statement, when I want the content to appear in more than one guide (e.g., <ph product="product1 product3")XXX</ph>. This works well - my ditaval has a statement to include content marked PRODUCT1, and a statement to exclude content marked PRODUCT3, but I get the expected result (the INCLUDE overrides the EXCLUDE. In some cases, the content should appear in all guides EXCEPT 1 or 2 guides. In that case, I would like to use "not" attributes to identify content that I do not want to include in the guide (e.g., <ph product="not-product1 not-product3")XXX</ph>. This works if I only include one "not" condition <ph product="not-product1")XXX</ph>, but it does not work if I include two conditions as shown earlier. The ditaval file for my transform has this exclude statement for the current product, but the ditaval file does not have an explicit INCLUDE or EXCLUDE for the other "not" condition (e.g., not-product3). I was expecting the ditaval to treat this statement like an "OR" statement, and exclude the content if the content has the label "not-product1" or "not-product3", but that is not happening; the content is being included. Is this something that is not supported? Do I need a more complex exclude statement, something that would be the equivalent of EXCLUDE if val = "not-product1" AND anything else...
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: excluding content from transform question, product attribute

Post by Radu »

Hi,

The DITA specification's DITAVAL flagging is explained here:

http://docs.oasis-open.org/dita/dita/v1 ... #filtering

Any enhancement outside of the DITA specification is not supported.
If you consider that the specs is not obeyed in your case please try to put together a small sample DITA project with a map and one or two topics, send it to support@oxygenxml.com and we can take a look at it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
protl
Posts: 13
Joined: Mon Dec 18, 2017 10:52 pm

Re: excluding content from transform question, product attribute

Post by protl »

Thanks Radu. Can you please verify that I have understood this correctly, based on my two examples below.

EXAMPLE 1:
I want a paragraph to appear in two guide only, so I set it up like this:
<p product="product1 product2">Paragraph to appear in two guides only</p>

And I have these two statements in my DITAVAL file for the PRODUCT 1 guide:
<prop att="product" val="product1" action="include"/>
<prop att="product" val="product2" action="exclude"/>

In this case, the content is included in the guide for PRODUCT 1, because the explicit INCLUDE causes the content to be included, even though there is also an explicit EXCLUDE. Correct? (Based on this text: "the attribute evaluates to "exclude" only when ALL the values in that attribute evaluate to "exclude"").

EXAMPLE 2:
I want a paragraph to appear in all guides, EXCEPT FOR two guides, so I set it up like this:
<p product="not-product1 not-product2">Paragraph excluded from two guides only</p>

And I have this statement in my DITAVAL file:
<prop att="product" val="product1 action="exclude"/>

In this case, the content is included in the guide for PRODUCT 1, because I have not explicitly excluded content for product2 from my guide, and so there is an implicit INCLUDE for product2 (meaning that not all of the attributes evalute to "exclude"). Correct?
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: excluding content from transform question, product attribute

Post by Radu »

Hi,
In this case, the content is included in the guide for PRODUCT 1, because the explicit INCLUDE causes the content to be included, even though there is also an explicit EXCLUDE. Correct? (Based on this text: "the attribute evaluates to "exclude" only when ALL the values in that attribute evaluate to "exclude"")
Yes.
In this case, the content is included in the guide for PRODUCT 1, because I have not explicitly excluded content for product2 from my guide, and so there is an implicit INCLUDE for product2 (meaning that not all of the attributes evalute to "exclude"). Correct?
And yes. For example our Oxygen XML User's Guide is written in DITA and our DITAVAL for generating the documentation for XML Author looks like this:

Code: Select all

<val>
<prop action="exclude" att="product" val="editor"/>
<prop action="exclude" att="product" val="editorEclipse"/>
<prop action="exclude" att="product" val="authorEclipse"/>
<prop action="exclude" att="product" val="developer"/>
<prop action="exclude" att="product" val="developerEclipse"/>
<prop action="exclude" att="product" val="svnClient"/>
<prop action="exclude" att="product" val="webauthor"/>
<prop action="exclude" att="product" val="fusion"/>
<prop action="exclude" att="product" val="waCustom"/>
<prop action="exclude" att="product" val="chemistry"/>
<prop action="exclude" att="product" val="pdf-css"/>
<prop action="exclude" att="product" val="webhelp"/>
<prop action="exclude" att="product" val="webhelp-responsive"/>

<prop action="include" att="product" val="author"/>
</val>
excluding explicitly any other value. But from what I think we could have simplified it to this:

Code: Select all

<val>
<prop action="exclude" att="product"/>
<prop action="include" att="product" val="author"/>
</val>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
protl
Posts: 13
Joined: Mon Dec 18, 2017 10:52 pm

Re: excluding content from transform question, product attribute

Post by protl »

thank you again Radu. That's really helpful, especially the shortcut for excluding all product values at once!
Post Reply