Output HTML file names that are different from the source DITA topic file names?
Posted: Fri Oct 16, 2020 9:54 am
Suppose:
Now suppose that, for reasons beyond my control (please don't ask why; my question can be considered without these reasons), all of the DITA topic file names have been changed to non-descriptive names. For example, xya1234567890123.dita. And all of the references to those files, such as topicrefs and xrefs, also now cite those non-descriptive file names.
When I transform this DITA, the resulting HTML output file names again match the DITA topic file names. Except that, now, it's xya1234567890123.html.
The original topic id attribute values remain unchanged.
I'd like to use those descriptive id attribute values, not the new topic file names, as the basis for the output HTML file names.
Has anyone already faced this situation, and customized DITA-OT to use the topic root element id attribute value as the output HTML file name?
I've started looking at html-generation-utils.xsl, but if someone else has already been here, I'd be grateful for some tips. For example, I haven't yet looked closely enough at that XSLT to know whether customizing that code will affect all references (such as HTML <a href="..."> elements) to the output HTML files, or whether I must also make changes elsewhere.
Note: I've read the article "DITA Map Design: Using Keys to Produce Reliable Anchor IDs for Deliverables", which states:
- I have a set of DITA topic files that I have named descriptively. For example, abc_installing.dita (without the "ing", if you prefer; let's not digress ).
- In each case, the topic root element id attribute value matches the file name, without the file extension. For example, <task id="abc_installing">.
Now suppose that, for reasons beyond my control (please don't ask why; my question can be considered without these reasons), all of the DITA topic file names have been changed to non-descriptive names. For example, xya1234567890123.dita. And all of the references to those files, such as topicrefs and xrefs, also now cite those non-descriptive file names.
When I transform this DITA, the resulting HTML output file names again match the DITA topic file names. Except that, now, it's xya1234567890123.html.
The original topic id attribute values remain unchanged.
I'd like to use those descriptive id attribute values, not the new topic file names, as the basis for the output HTML file names.
Has anyone already faced this situation, and customized DITA-OT to use the topic root element id attribute value as the output HTML file name?
I've started looking at html-generation-utils.xsl, but if someone else has already been here, I'd be grateful for some tips. For example, I haven't yet looked closely enough at that XSLT to know whether customizing that code will affect all references (such as HTML <a href="..."> elements) to the output HTML files, or whether I must also make changes elsewhere.
Note: I've read the article "DITA Map Design: Using Keys to Produce Reliable Anchor IDs for Deliverables", which states:
While I'm open to discussing that in more detail, right now, I'm more interested in a solution that uses topic id attribute values as the basis for output HTML file names.There are a number of reasons a simple mapping of source filenames and IDs to deliverable anchor IDs will not work