Page 1 of 1

Flagging using specialized conditional attributes

Posted: Wed May 25, 2016 7:21 pm
by windsport
Hi, I'm new to dita and text tranformation but I got a very interessting project where I want to use it.

I defined some custom attributes by specializing the @props attribute (I followed the guide given in http://drmacros-xml-rants.blogspot.de/2 ... ional.html).

The attributes work i.e. include / exclude results in the corresponding elements to be part / not part of the text transformed. Transformation is controlled using a DITAVAL file.

When changing the action from "include" to "flag" the alternative text (defined in <alttext> within the <startflag> element) does not appear.

The predefined attributes work well using the "flag" action (e.g. @audience) but the attribute that is defined in the same way as the custom attributes (@deliveryTarget) doesn't either behave as specified.

I don't have a clue how to get the flagging mechanism work. Does anybody have an idea? Thanks in advance :)

Re: Flagging using specialized conditional attributes

Posted: Thu May 26, 2016 4:02 pm
by Radu
Hi,

Oxygen 17.1 and newer comes with two DITA Open Toolkit publishing engines bundled. You can configure in the Preferences->DITA page which one should be used. With DITA OT 1.8 I can flag paragraphs which use a specialization props attribute but indeed from what I tested with DITA OT 2.x flagging no longer works using a specialization of props.
I added an issue here:

https://github.com/dita-ot/dita-ot/issues/2392

If you want a quick fix suggestion, you can open the XSLT stylesheet:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT2.x\xsl\preprocess\flagImpl.xsl

and from the XSLT template:

Code: Select all


  <xsl:template name="ext-getrules" as="element()*">
............
remove the as attribute along with its value something like:

Code: Select all


  <xsl:template name="ext-getrules">
............
Regards,
Radu

Re: Flagging using specialized conditional attributes

Posted: Thu Jun 09, 2016 12:25 pm
by chrizzbee
Not directly related to specializations of @props but somehow related. According to the spec, @props is a conditional processing attribute. Whether in OT1.8 nor in OT2.x I could flag content by just using the @props attribute. @platform, @audience, @product and @otherprops all work, but not @props. When I check DITAOT\xsl\preprocess\flagImpl.xsl, I see nowhere templates or rules for @props (but for specializations of it). Is there a reason why @props doesn't work out-of-the-box for flagging?

Re: Flagging using specialized conditional attributes

Posted: Thu Jun 09, 2016 2:16 pm
by Radu
Hi,

From what I remember (and I could be wrong) the @props attribute was initially added as only a base for specializations. Neither profiling nor flagging worked with it. But at some point they decided that it should also work on its own so that is probably the time when filtering support was added for it.
So I agree that flagging should also work with @props, I added a comment on the issue that I previously added:

https://github.com/dita-ot/dita-ot/issues/2392

Regards,
Radu

Re: Flagging using specialized conditional attributes

Posted: Thu Jun 09, 2016 2:22 pm
by chrizzbee
Thanks Radu