Ditavalref is not working in combination with keyref

Having trouble installing Oxygen? Got a bug to report? Post it all here.
karim88
Posts: 1
Joined: Fri Jun 22, 2018 9:37 am

Ditavalref is not working in combination with keyref

Post 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>
Radu
Posts: 9451
Joined: Fri Jul 09, 2004 5:18 pm

Re: Ditavalref is not working in combination with keyref

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply