Providing additional attributes for published HTML

Post here questions and problems related to editing and publishing DITA content.
IanMayo
Posts: 10
Joined: Thu Jun 08, 2023 6:46 pm

Providing additional attributes for published HTML

Post by IanMayo »

I wish to add table sorting to my published HTML.
1. I've added the JS sources to this library to my `libraries` fragment: https://www.kryogenix.org/code/browser/sorttable/
2. I've used `outputclass` to label the relevant table as `sortable`
3. I need to include a custom attribute `sorttable_customkey` in the exported HTML:

Code: Select all

<td sorttable_customkey="2">two</td><td>Jan</td>
Is there a way to do this using the standard DITA attributes for a table cell `entry` in OxygenXML Author?
julien_lacour
Posts: 621
Joined: Wed Oct 16, 2019 3:47 pm

Re: Providing additional attributes for published HTML

Post by julien_lacour »

Hello,

Could you indicate which version of Oxygen you are using?

Could you also indicate in which scenario you want to make this modification?
Published HTML formats include HTML5, XHTML and WebHelp Responsive.

In any of these cases you will need to implement the modification in an XSLT stylesheet in order to convert the outputclass into sorttable_customkey.

Regards,
Julien
IanMayo
Posts: 10
Joined: Thu Jun 08, 2023 6:46 pm

Re: Providing additional attributes for published HTML

Post by IanMayo »

Hello Julien,
sorry - I missed your reply.

The publishing would be to WebHelp responsive.

I think I'm going to find it easier to specify the attribute as a custom class on the table cell via `outputclass` - like `customkey_xxx`. Then I'll modify the JS code to check for this class prefix in the class names for that element, and use the remaining text as the key if present.

Thanks for your support Julien,
Ian
Post Reply