use of ditaval with DITA-OT1.8.5

84 views
Skip to first unread message

Martin Mueller

unread,
Nov 11, 2015, 4:16:55 AM11/11/15
to DITA-OT Users


Dear Experts,

the different outputs of guidelines require different sizes of the images embedded.
For the pdf-version I prefer
<image href="../image/WorkStepsOfAnnotation_2.jpg" align="left" height="300" width="500"/>
for the xhtml-version I prefer
<image href="../image/WorkStepsOfAnnotation_2.jpg" align="left" height="600" width="1000"/>

My choice is to employ conditional processing based on a ditaval file which modifies the latter line to
<image platform="windows" href="../image/WorkStepsOfAnnotation_2.jpg" align="left" height="600" width="1000"/>
(for the other image analogously)

with the ditaval being ("XHTMLoutput.ditaval")
<?xml version="1.0" encoding="UTF-8"?>
<val>
    <prop att="platform" val="windows" action="include"/>
    <prop att="platform" val="linux" action="exclude"/>
</val>
("PDFoutput.ditaval" analogous)

and the command line

ant -Dargs.input=F:\<pathname>\<ditamapname>.ditamap -Dtranstype=xhtml -Dparameter-name=1 -Dargs.filter=F:\<pathname>\XHTMLoutput.ditaval -Doutput.dir=F:\<pathname>\out

The conditional processing, however, simply does not work. Both images are embedded each time when I run the command.
Since I intend to use conditional processing for other purposes as well I would be grateful for any hint, where the mistake is located. Is the ant-parameter wrong?

Kind regards,
Martin

Julio Vazquez

unread,
Nov 11, 2015, 7:38:10 AM11/11/15
to DITA-OT Users
Hi,

What you've shown in your post doesn't indicate whether you've set the platform attribute on the image elements. If you is true, your ditaval has no affect.

If you need to do the same thing for all images, you'd be better off using xslt to alter the dimensions.

Martin Mueller

unread,
Nov 11, 2015, 11:10:24 AM11/11/15
to DITA-OT Users
Hallo Julio,

within the topic I have written


<image platform="windows" href="../image/WorkStepsOfAnnotation_2.jpg" align="left" height="600" width="1000"/>
<image platform="linux" href="../image/WorkStepsOfAnnotation_2.jpg" align="left" height="300" width="500"/>

and in the DOS command line I use

ant -Dargs.input=F:\<pathname>\<ditamapname>.ditamap -Dtranstype=xhtml -Dparameter-name=1 -Dargs.filter=F:\<pathname>\XHTMLoutput.ditaval -Doutput.dir=F:\<pathname>\out
for the HTML-output
or
ant -Dargs.input=F:\<pathname>\<ditamapname>.ditamap -Dtranstype=pdf -Dparameter-name=1 -Dargs.filter=F:\<pathname>\PDFoutput.ditaval -Doutput.dir=F:\<pathname>\out
for the PDF-output

with the ditaval files including and excluding the respective 'platform', i.e. image. 'platform' is a bit misleading, I just used it as a boolean, to avoid an error in using unallowed attributes.

Using XSLT is indeed a good idea, since the switching applies to almost all figures in my case, but I want to learn what is wrong in my usage of the ditaval-based conditional processing.

Thank you,
Martin

Julio Vazquez

unread,
Nov 11, 2015, 11:29:15 AM11/11/15
to DITA-OT Users
Hi Martin,

Based on your second post, it should work. The only possible problem might be things like extraneous spaces in the value either in the prop or the image element or case mismatch. The only other possibility is that your ditaval file isn't being found for some reason. You need to look at the log file to determine if this is the case. You may want to add > test.log to the end of your command.

Julio

Kendall Shaw

unread,
Nov 11, 2015, 1:31:20 PM11/11/15
to dita-o...@googlegroups.com
Just to add to what Julio says. You can look for args.filter = ... in the log file to see if somehow it is not being passed to ant (it should says args.filter=f:\...\file (your ditaval file)).

Also 2>&1 test.log instead of > test.log can captures some messages that would not be captured otherwise.

If the log doesn't tell you anything it might be worth trying to add a platform attribute to something in the taskbook sample book and use your ditaval file to verify that filtering works as expected in general.

Kendall
--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Mueller

unread,
Nov 12, 2015, 11:08:45 AM11/12/15
to DITA-OT Users
Now it works. I checked all the log-file and so on. My fault: the ditaval could not be found due to a mistaken <pathname> in the command line. But I have learned something. Thanks.
Reply all
Reply to author
Forward
0 new messages