Automatic ID Generation for Topics
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 3
- Joined: Wed Dec 19, 2018 2:21 pm
Automatic ID Generation for Topics
Hello,
I stumbled upon an unexpected (at least for me) behaviour when creating new .dita files.
Here is what I do:
1) File -> New...
2) In the "Choose a file template" dialog I choose my custom template which has the following structure:
3) I enter a title for the topic ("test" in this case)
4) I check the "Save as" button and edit the path to my liking (filename: "test.dita")
5) I click "Create"
After this, the created file has an incorrect id. The result is the following:
So the id is set to be the same as the name of the file.
If I do the following:
1) File -> New...
2) In the "Choose a file template" dialog I choose my custom template again (same as last example)
3) I do NOT enter a title or check the "Save as" button
4) I click "Create"
Now, the file gets the correct id. Result being the following:
So my question is: is this expected behavior? It certainly confused me.
I stumbled upon an unexpected (at least for me) behaviour when creating new .dita files.
Here is what I do:
1) File -> New...
2) In the "Choose a file template" dialog I choose my custom template which has the following structure:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_${id}">
<title>${caret}</title>
...
</topic>
4) I check the "Save as" button and edit the path to my liking (filename: "test.dita")
5) I click "Create"
After this, the created file has an incorrect id. The result is the following:
Code: Select all
<topic id="test">
<title>test</title>
...
</topic>
If I do the following:
1) File -> New...
2) In the "Choose a file template" dialog I choose my custom template again (same as last example)
3) I do NOT enter a title or check the "Save as" button
4) I click "Create"
Now, the file gets the correct id. Result being the following:
Code: Select all
<topic id="topic_vl4_trw_vgb">
<title/>
...
</topic>
-
- Posts: 417
- Joined: Mon May 09, 2016 9:37 am
Re: Automatic ID Generation for Topics
Post by sorin_carbunaru »
Hello,
If you go to Options > Preferences > DITA > New topics, you will see there's a Use the file name as the value of the root ID attribute check box that is selected by default. This check box controls what happens when you create and save a topic, but not when you create an untitled editor, and it is more powerful than the editor variables (such as ${id}) from the templates So, if you want to generate a random ID instead of the one based on the title, deselect the above-mentioned option.
All the best wishes,
Sorin Carbunaru
oXygen XML
If you go to Options > Preferences > DITA > New topics, you will see there's a Use the file name as the value of the root ID attribute check box that is selected by default. This check box controls what happens when you create and save a topic, but not when you create an untitled editor, and it is more powerful than the editor variables (such as ${id}) from the templates So, if you want to generate a random ID instead of the one based on the title, deselect the above-mentioned option.
All the best wishes,
Sorin Carbunaru
oXygen XML
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