Ditaval + subject scheme: automatically filter parent subject

jochemdevos
Posts: 20

Ditaval + subject scheme: automatically filter parent subject

Wed May 10, 2017 3:13 pm

Hi all,

We're a bit stuck when working on a Taxonomy using a subject scheme. To try to understand this I've pulled out some demo data found at https://www.oxygenxml.com/doc/versions/ ... e-map.html

So the scheme is as follows:

Code: Select all

<subjectScheme>
    <subjectdef keys="users">
        <subjectdef keys="therapist">
            <subjectdef keys="novice"/>
            <subjectdef keys="expert"/>
        </subjectdef>
        <subjectdef keys="oncologist"/>
        <subjectdef keys="physicist"/>
        <subjectdef keys="radiologist"/>
    </subjectdef>
    <enumerationdef>
        <attributedef name="audience"/>
        <subjectdef keyref="users"/>
    </enumerationdef>
</subjectScheme>

And the DITAVAL is as follows, for demo purposes:

Code: Select all

<val>
    <prop action="exclude" att="audience" val="therapist" />
</val>

When profiling content (Select element, right click, edit profiling attributes) the audience attribute provides checkboxes as described by the scheme. When selecting a lower level subject to filter on, the parent is not automatically checked, which is okay I suppose as long as the processors can make the relation with the parent.

Question 1: When using 'Import from DITAVAL' to create a Profiling set, the filter in Author mode is applied as I would suspect: content flagged with 'novice', which is a novice therapist, is excluded. However, when running a PDF transformation with the DITAVAL set as filter it only excludes content tagged with 'therapist'. Why is this the case?

Question 2: Is it also possible to get this 'inherited filtering' when using the exclude unless included approach, e.g.:

Code: Select all

<val>
    <prop action="exclude" att="audience"/>
    <prop action="include" att="audience" val="therapist" />
</val>

Here's some demo content that I used:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_vcz_2nm_vz">
  <title>Test</title>
  <body>
    <p>Content marked with nothing</p>
    <p audience="oncologist">Content marked with oncologist</p>
    <p audience="therapist">Content marked with therapist</p>
    <p audience="novice">Content marked with novice therapist</p>
  </body>
</topic>

Thanks you, kind regards,
Jochem de Vos
Radu
Posts: 5684

Re: Ditaval + subject scheme: automatically filter parent subject

Wed May 10, 2017 4:01 pm

Hi Jochem,

Support for filtering content based on subject schemes in the DITA Open Toolkit publishing engine is not really complete, so you may encounter various problems with it.
Please see some answers below:

When profiling content (Select element, right click, edit profiling attributes) the audience attribute provides checkboxes as described by the scheme. When selecting a lower level subject to filter on, the parent is not automatically checked, which is okay I suppose as long as the processors can make the relation with the parent.


Exactly.

Question 1: When using 'Import from DITAVAL' to create a Profiling set, the filter in Author mode is applied as I would suspect: content flagged with 'novice', which is a novice therapist, is excluded. However, when running a PDF transformation with the DITAVAL set as filter it only excludes content tagged with 'therapist'. Why is this the case?


The topicref to the subject scheme map needs to have the attribute type="subjectScheme" set on it otherwise the hierarchical filtering does not work. This is not required by the specification, it is a bug/limitation in the publishing engine.

Question 2: Is it also possible to get this 'inherited filtering' when using the exclude unless included approach, e.g.:


Not sure, you can try that after following the advice above.

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

Re: Ditaval + subject scheme: automatically filter parent subject

Thu May 11, 2017 11:21 am

Thanks again for your help Radu.
Radu wrote:The topicref to the subject scheme map needs to have the attribute type="subjectScheme" set on it otherwise the hierarchical filtering does not work. This is not required by the specification, it is a bug/limitation in the publishing engine.

Perfect, including the type attribute did indeed filter the hierarchy properly during transformation. (exclude therapist when 'novice' is excluded in ditaval*)

Radu wrote:
Question 2: Is it also possible to get this 'inherited filtering' when using the exclude unless included approach, e.g.:

Not sure, you can try that after following the advice above.

Unfortunately this does not work. As I remember from documentation: the parent only inherits filtering if the ditaval does not specify what to do with it. It seems a general exclude (<prop action="exclude" att="audience"/>) gets priority over an include on a child subject (novice).

*edited: meant to say exclude instead of include
Last edited by jochemdevos on Tue May 16, 2017 12:01 pm, edited 1 time in total.
Radu
Posts: 5684

Re: Ditaval + subject scheme: automatically filter parent subject

Mon May 15, 2017 4:51 pm

Hi Jochem,

I confirm your findings for (2), not sure if it's on purpose or a side effect of the Subject Scheme filtering support not being fully implemented.

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

Re: Ditaval + subject scheme: automatically filter parent subject

Tue May 16, 2017 12:12 pm

Radu wrote:I confirm your findings for (2), not sure if it's on purpose or a side effect of the Subject Scheme filtering support not being fully implemented.


Hi Radu,

I guess this works as designed. Although I'm interested how you or others would work around this, for those that use a subjectscheme with nested subjectdef elements.

Kind regards,
Jochem de Vos

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

Who is online

Users browsing this forum: No registered users and 1 guest