Automatic ID Generation for Topics
Posted: Wed Feb 20, 2019 4:04 pm
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>