Home Forums DITA and XMetaL Discussion How do you use <prereq> in web help? Reply To: How do you use <prereq> in web help?

Derek Read

Reply to: How do you use <prereq> in web help?

WebHelp relies on files included with the standard DITA OT XHTML transtype to transform to XHTML. This transtype does nothing special to identify the element markup-wise in the XHTML; it inserts a

with a class attribute value of “p”. If you want something else to appear in the output you will need to modify the XSLT.

The file that handles this part of the transformation is here:

Around line 65 there's a section that begins like so:





The second to last line above is probably where you will want to start mucking around.

The simplest thing to do would be to change the value for the class to be unique so you can more easily address it in your CSS. You might also stick in a heading, perhaps like so:






Then in your CSS you can address that section and each portion it contains with specific styling if you want:

div.prereq {border:1px solid red}
div.prereq h2 {font-family: "Comic Sans"; font-size: 1.2em; color: red}

This change is not changing the Webhelp output directly, it is changing files in the XHTML transtype that are used by other parts of the DITA OT. This means it will affect WebHelp, but also CHM, Multiple HTML, Single HTML, Eclipse Help, Java Help, etc. I assume this is what you would want because then all your various HTML-like outputs will be similar.