Page 1 of 1

Output HTML file names that are different from the source DITA topic file names?

Posted: Fri Oct 16, 2020 9:54 am
by Graham Hannington
Suppose:
  • 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">.
When I transform this DITA to HTML(5), the resulting HTML output file names match the original DITA topic file names. For example, abc_installing.html.

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:
There are a number of reasons a simple mapping of source filenames and IDs to deliverable anchor IDs will not work
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.

Re: Output HTML file names that are different from the source DITA topic file names?

Posted: Fri Oct 16, 2020 1:34 pm
by Costin
Hi,

We consider that using the ID from the root element of the topic as file name is not possible.

However, as this is more a DITA related questions, rather than an oXygen one, you should give it a try and raise the question on the DITA Users lists (https://groups.google.com/g/dita-ot-users?pli=1 and https://groups.yahoo.com/neo/groups/dit ... ccounter=1).
There are a lot of DITA specialists there which could probably help you with more in-depth suggestions.

Best Regards,
Costin

Re: Output HTML file names that are different from the source DITA topic file names?

Posted: Sun Oct 18, 2020 4:05 pm
by Graham Hannington
Hi Costin,

Thanks very much for your reply.

You wrote:
We consider that using the ID from the root element of the topic as file name is not possible.
"Not possible" is strong language!

It is possible if the author takes on the responsibility of ensuring that the id attribute value of each topic is unique in the context in which it is to be used, such as a map for formatting to HTML5.

However, if the author does not take on that responsibility, then, yes, I agree: "not possible" is true in the sense that, according to the XML standard, the id attribute value must be unique only within the XML document. There's no requirement for uniqueness across XML documents.

Is it good practice? No! In the context I'm discussing, where previously descriptive DITA file names are replaced with non-descriptive names, I'll freely admit: I'm clutching at straws.

Re: Output HTML file names that are different from the source DITA topic file names?

Posted: Mon Oct 19, 2020 12:15 pm
by Costin
Hi,

Unfortunately, besides the ID unicity issue, this would also involve renaming any topic file references.
There is no predefined support for such use-case in the WebHelp product.
As we are not aware of such possibility, so I'm afraid that we could not help with any advise.

Like I previously mentioned, there could be DITA experts that encountered this need and which my have better expertise in helping you out, so feel free to ask this on the DITA Users lists which I mentioned in my previous reply.

Regards,
Costin

Re: Output HTML file names that are different from the source DITA topic file names?

Posted: Tue Nov 24, 2020 7:17 am
by Graham Hannington
After considering the options, including the DITA Users List (thanks for the suggestion!), I decided to ask a different, but closely related, question on Stack Overflow: "(How) does IXIASOFT CCMS support semantic URLs in HTML output?".

Re: Output HTML file names that are different from the source DITA topic file names?

Posted: Mon Apr 11, 2022 8:59 pm
by simonbate
Hmm, the Stack Overflow question was removed "for reasons of moderation" (which boggles the imagination).
I'm also curious about this topic and was hoping I'd find something via that link.
Can anyone provide any more information about the answer?

Thanks,
Simon