Page 1 of 1

Ditavalref is not working in combination with keyref

Posted: Fri Jun 22, 2018 9:57 am
by karim88
I have the following problem. I want to use keyrefs instead of hrefs in my ditamap. I want also use a ditaval-filtering to switch between to different images for my main_page. but if i use keyrefs instead of hrefs in my ditamap i see both pictures at the same time. if i use hrefs it works smoothly (only the wished picture is shown...the image which is needed to filter is filtered by the ditaval-file).
Can please help me somebody out from this problem? :roll:

I have this ditamap (this is a neckline of the file):

Code: Select all


<map> 
!---href="main_page.dita .....filtering works only with direct linking.... --->
<topicref keyref="main_page">
<ditavalref href="filtering.ditaval"></ditaval>
</topicref>
</map>
My ditaval look like this (this is a neckline of the file):

Code: Select all


<val> 
<prop action ="include" att="product" val="product_one"
<prop action="exclude" att="product" val="product_two"
</val>
My main_page.dita looks like this (this is a neckline of the file):

Code: Select all


<ph product="product_one">
<image keyref="pic_one" height="100"></image>
</ph>
<ph product="product_two">
<image keyref="pic_two" height="100"></image>
</ph>
My keydef.ditamap is like this (this is a neckline of the file):

Code: Select all


<map>
<keydef keys="main_page" href="main_page.dita"/>
<keydef keys="pic_one" href="dita/config/resources/one.png" format="png"/>
<keydef keys="pic_two" href="dita/config/resources/two.png" format="png"/>
</map>

Re: Ditavalref is not working in combination with keyref

Posted: Fri Jun 22, 2018 2:54 pm
by Radu
Hi,

This looks like a limitation of the publishing engine.
The publishing engine has many separate stages, one of them resolves keyrefs and another of them does the branch filtering.
By default the branch filtering stage comes first but because the "ditavalref" is set on a topicref containing a keyref attribute, that keyref has not yet been expanded by the keyref expansion stage. So this is probably why this does not work.

Regards,
Radu