Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch filtering has no effect on content reused via conref mechanism #4375

Open
Nico-Amplexor opened this issue Jan 31, 2024 · 4 comments
Open
Labels

Comments

@Nico-Amplexor
Copy link

Actual Behavior

Branch filtering has no effect on content reused via conref mechanism. See sample: li items in reuse.dita are not filtered.

Expected Behavior

Branch filtering works on content reused via conref mechanism.

Steps to Reproduce

test.ditamap

<map>
    <title>Test</title>
    <topicref href="concept_test.dita">
        <ditavalref href="filter.ditaval"/>
    </topicref>
</map>

concept_test.dita

<concept id="concept_test">
    <title>Concept test</title>
    <shortdesc></shortdesc>
    <conbody>
        <div conref="reuse.dita#concept_test/reuse"/>
    </conbody>
</concept>

reuse.dita

<concept id="concept_test">
    <title>Reuse</title>
    <shortdesc></shortdesc>
    <conbody>
        <div id="reuse">
            <ul>
                <li product="product001">Item 1</li>
                <li product="product002">Item 2</li>
                <li product="product002">Item 3</li>
            </ul>
        </div>
    </conbody>
</concept>

filter.dita

<val>
    <prop action="exclude" att="product"/>
    <prop action="include" att="product" val="product001"/>
</val>

Possible Solution

To make filtering works, you can apply branch filtering directly on reuse.dita file

<map>
    <title>Test</title>
    <topicref href="concept_test.dita"/>    
    <topicref href="reuse.dita" processing-role="resource-only">
        <ditavalref href="filter.ditaval"/>
    </topicref>
</map>

Environment

  • DITA-OT version: 4.1.2
  • Operating system and version: Windows 10
  • How did you run DITA-OT? Oxygen transformation scenario
  • Transformation type: pdf2
@jelovirt
Copy link
Member

jelovirt commented Feb 4, 2024

This doesn't work because branch filtering is done before conref.

@raducoravu
Copy link
Member

In general, also because of issues like this, once you start using branch filtering, all direct links and conrefs need to be replaced with indirect keyrefs, conkeyrefs and you need to define a keyscope on the topicref which has the branch filter condition. Plus the reusable file would need to be referenced inside the branch:

<topicref href="concept_test.dita" keyscope='ks'>
    <ditavalref href="filter.ditaval"/>
   <keydef href="reuse.dita" keys="reusables"/>
</topicref>

and the reference inside "concept_test.dita" would become:

    <div conkeyref="reusables/reuse"/>

@jelovirt
Copy link
Member

jelovirt commented Feb 5, 2024

There are changes to the way we do processing we could make, but they are in the category of Takes Time To Develop, so this will not be fixed in the immediate future.

@Nico-Amplexor
Copy link
Author

@raducoravu , @jelovirt , thanks a lot for these informations and for the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants