Branch filtering not working in OT 2.5.3?
See original GitHub issueExpected Behavior
I have a small project which I’m using as a POC of branch filtering. In this example, I use @conkeyref to bring in the content I require. Each branch has a different ditavalref which should filter out the content excluded by the @product value.
Actual Behavior
All of the content that should be filtered out on a particular branch is not being filtered out. Looking at the temp files, the content is brought in. Global filtering appears to be working. This fails even if I use a simple conref, so it appears as if filtering is not being invoked for each branch. branch_filter_example.zip
Possible Solution
Steps to Reproduce
- Unzip the attached test files
- Run dita -i branch_filter_example -f html5
- Launch the resulting output file
Copy of the error message, log file or stack trace
Environment
- DITA-OT version: 2.5.3
- Operating system and version: Windows 10 (Linux, macOS, Windows)
- How did you run DITA-OT? oXygen 19 and command line
(
dita
command, Ant,startcmd
, oXygen, other editor, CMS, etc.) - Transformation type: webhelp on oXygen, HTML5 in command line. (HTML5, PDF, custom, etc.)
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Push event branch filtering not working for group-level ...
Push event branch filtering is not working for group-level webhooks. Customer is running into this issue on v11.3.5-ee (Zendesk link, internal ...
Read more >Branch filtering (branch-filter) - DITA Open Toolkit
The branch-filter step filters topics using DITAVAL files defined in the map.
Read more >RDataFrame performance for branch reduction and event ...
I'm trying to perform the following operations of the ntuples of my analysis: Select subset of branches (i.e slimming); Modify the weights to...
Read more >Working with DITA 1.3 Branch Filtering - Oxygen 18.1 - Titania Delivery
In DITA 1.2, this is not possible since you can only apply one DITAVAL filter to a map. However, with the DITA 1.3...
Read more >Selecting a branch always forces the filter to "All Branches ...
Selecting a branch always forces the filter to "All Branches" ... Linked Issues: ... isn't the easiest to use, either, as if there...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The behavior you are describing seems to be normal.
Branch-filtering happens before key resolution (see http://www.dita-ot.org/2.5/dev_ref/DITA-OTPreprocess.html).
Your
<ditavalrefs>
elements are nested under<topicrefs>
pointing to topics where no@product
attributes are used.Nothing is profiled in
first_branch.dita
When Branch-filtering happens nothing is filtered because nothing is profiled.
You profiled things in your keydef.
But the
<ditavalref>
does not apply here.There are several strategies to make it work.
The easiest one would be to profile in the
<topicref>
:Another solution, maybe more elegant :
@keyscope
to each branch.Note the
<ditavalmeta>
adding a suffix to the duplicated resources.filtered_product_name
under inside a<ph >
element with the@id
.This way you only need
<ph conkeyref="reusable/filtered_product_name"/>
to refer to the filtered product name.Since the keydef is in the branch, it is filter during Branch-filtering and when the Keyrefs are resolved only the filtered product name remains.
Working ditamap and file: branch_filter_example-keyscopes.zip
There are other ways but I think I will make a pull-request in the doc repo rather than a response to this thread 😃
I appreciate the clarifications. I guess that I should have looked at the OT documentation about the implementation as the spec doesn’t address the order of resolution.