Unwanted behavior: Author converts hyphens in the topic file name to underscores in the id
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 49
- Joined: Mon Jun 13, 2016 11:23 am
Unwanted behavior: Author converts hyphens in the topic file name to underscores in the id
Post by Graham Hannington »
Historically (sorry, I can't cite a specific Oxygen XML Author version), when I duplicated a DITA topic and saved the duplicate with a new file name, such as prodx-intro.dita (note the hyphen in the file name), Author automatically set the root element id attribute value to the file name without the file extension. For example: id="prodx-intro". I liked that.
However, when generating the id attribute, Author 26.1 replaces hyphens in the file name with underscores. For example: id="prodx_intro". I don't like that.
I know how to "revert" this unwanted behavior:
I'm bothering writing about this for a few reasons, including:
However, when generating the id attribute, Author 26.1 replaces hyphens in the file name with underscores. For example: id="prodx_intro". I don't like that.
I know how to "revert" this unwanted behavior:
- Select Options > Preferences > DITA > Topics
- Under New Topics: "Use the title to generate the file name", which is selected by default, change the value of "Replace non-alphanumeric characters" from an underscore (_) to a hyphen (-).
I'm bothering writing about this for a few reasons, including:
- I don't like this fix. It feels like a hack. It doesn't feel right to me to change a suboption of "Use the title to generate the file name" to change the generated id attribute value when, in my case, I'm manually specifying the file name.
- I'm wondering if this change in behavior is due to a change in the "proprietary" DITA framework I'm using rather than a change in Author itself. I'm using Author to edit DITA topics that use organization-specific DITA DTDs. That organization used to supply an installation of Author precustomized for those DTDs. However, recently, that organization changed to supplying a separate, cut-down version of those customizations that now have to be applied post-install. Possibly related: when I select Refactoring > XML Refactoring, I now no longer see "Change topic ID to file name" as a refactoring operation for DITA topics with these organization-specific DTDs.
Re: Unwanted behavior: Author converts hyphens in the topic file name to underscores in the id
Hello Graham,
Indeed in Oxygen 26.1 we had a change in behavior in this regard as before Oxygen 26.1 the generated IDs would always contain "_" inside them and we had users who wanted to be able to control them to be "-" hyphen instead. Maybe we should have added a separate setting, I added an internal issue based on your report, pasting the issue ID below for future reference:
EXM-55055 Duplicate DITA topic - default ID generation settings changed
If we fix the issue in a future version we will update this forum thread.
In the meantime you can use the setting you discovered.
Regards,
Radu
Indeed in Oxygen 26.1 we had a change in behavior in this regard as before Oxygen 26.1 the generated IDs would always contain "_" inside them and we had users who wanted to be able to control them to be "-" hyphen instead. Maybe we should have added a separate setting, I added an internal issue based on your report, pasting the issue ID below for future reference:
EXM-55055 Duplicate DITA topic - default ID generation settings changed
If we fix the issue in a future version we will update this forum thread.
In the meantime you can use the setting you discovered.
The lack of this specific XML refactoring is probably related to the fact you have a custom DITA framework which no longer ships it, this being a separate problem than the generation of the ID value you mentioned above.However, recently, that organization changed to supplying a separate, cut-down version of those customizations that now have to be applied post-install. Possibly related: when I select Refactoring > XML Refactoring, I now no longer see "Change topic ID to file name" as a refactoring operation for DITA topics with these organization-specific DTDs.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 49
- Joined: Mon Jun 13, 2016 11:23 am
Re: Unwanted behavior: Author converts hyphens in the topic file name to underscores in the id
Post by Graham Hannington »
Thanks for the confirmation/clarification and for creating that internal issue. Just my opinion: yes, I think a separate setting would be "cleaner".
Yes, I wasn't sure about that, thanks for the advice.The lack of this specific XML refactoring is probably related to the fact you have a custom DITA framework which no longer ships it
Very helpful, detailed response as always, Radu. Thank you!
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service