Two questions:
TOC files have been deleted but the topic XML files still exist.
1. Is there a way to generate the html files from the xml? I tried creating a page and then updating the ID but H&M returned the error that file ID already exists.
2. And I have a TOC entry, but when clicked, I get this message:
"This is a chapter entry without an associated topic."
However, the XML topic does exist. Can I/how do I associate them?
Thanks in advance.
Jones
associate XML files to missing TOC/HTML files
Moderators: Alexander Halser, Tim Green
- Tim Green
- Site Admin
- Posts: 23432
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: associate XML files to missing TOC/HTML files
Hi Mark,
The TOC is really just a list of links to the topics, each of which is a separate XML file. This is why deleting the TOC file has no effect on the topic files.
In your case the href attribute is either completely missing, or just empty (i.e.: href=""). You could edit the XML TOC file in the Maps folder of your project manually, but the easiest way to fix this is to delete the TOC entry and create a new one in one of two ways:
Method1: Drag the topic file from the Topic Files section into the TOC and drop it there. That will automatically create a TOC entry.
Method 2: Use the Add Topic tool to create a new topic. Choose the TOC Link tab in the dialog displayed, then select the Link to topic in this project option and choose the ID of the topic. (The ID is the name of the XML topic file.)
Note that if the href attribute of the TOC entry is there but references a topic file that doesn't exist, you will get a dead link message instead, and then you can choose the topic you want to link it to from a list.
The TOC is really just a list of links to the topics, each of which is a separate XML file. This is why deleting the TOC file has no effect on the topic files.
That happens automatically when you publish to an HTML-based format (WebHelp, eWriter, CHM, ePub, Kindle). With WebHelp you have the files directly, including the TOC in the hmcontent.html file and the individual HTML topic files. In the other formats you need to disable the Publish screen option for deleting the temporary files, then you will find the HTML source in a subfolder of the project folder with a name starting with a ~ character (~tmpexe for eWriter, ~tmpchm for CHM and so on).1. Is there a way to generate the html files from the xml? I tried creating a page and then updating the ID but H&M returned the error that file ID already exists.
This means that the href attribute of that TOC entry is missing or empty, which is the case with chapter entries that don't have a topic associated with them. A normal TOC entry in the XML TOC file looks like this:2. And I have a TOC entry, but when clicked, I get this message:
"This is a chapter entry without an associated topic."
However, the XML topic does exist. Can I/how do I associate them?
Code: Select all
<topicref type="topic" id="449673791886557" build="ALL" modified="2023-02-10T12:44:43.302Z" icon="0" href="Welcome-topic">
Method1: Drag the topic file from the Topic Files section into the TOC and drop it there. That will automatically create a TOC entry.
Method 2: Use the Add Topic tool to create a new topic. Choose the TOC Link tab in the dialog displayed, then select the Link to topic in this project option and choose the ID of the topic. (The ID is the name of the XML topic file.)
Note that if the href attribute of the TOC entry is there but references a topic file that doesn't exist, you will get a dead link message instead, and then you can choose the topic you want to link it to from a list.
Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Re: associate XML files to missing TOC/HTML files
I SUSPECT my question is the same?
After an import from AuthorIT several years back, I'm cleaning up the mess. AND... I just discovered. I have some "links" from topics that link directly to an .xml files under Project Files | Topic Files. There is no entry in the TOC Tree. The info shows up if I click the link in the resultant published output.
I don't even know if it is POSSIBLE to create this type of link easily when normally using H&M. Is this something to be concerned about? Or just roll with it? I'm guessing best practice is for everything to be IN the TOC Tree?
After an import from AuthorIT several years back, I'm cleaning up the mess. AND... I just discovered. I have some "links" from topics that link directly to an .xml files under Project Files | Topic Files. There is no entry in the TOC Tree. The info shows up if I click the link in the resultant published output.
I don't even know if it is POSSIBLE to create this type of link easily when normally using H&M. Is this something to be concerned about? Or just roll with it? I'm guessing best practice is for everything to be IN the TOC Tree?
Re: associate XML files to missing TOC/HTML files
Reread the earlier answer and it appears that my question (may) be that answer.
Still assuming that best practice is to not have orphaned .xml.
Still assuming that best practice is to not have orphaned .xml.
- Tim Green
- Site Admin
- Posts: 23432
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: associate XML files to missing TOC/HTML files
It's quite possible to have links to topics without TOC entries in WebHelp, CHM and eWriter, and often desirable. Sometimes you want to provide access to a page of information that doesn't have any sensible place in the TOC. Then you create a topic without a TOC entry by creating it directly in Topic Files, instead of in the TOC. You can also delete the TOC entry for a topic without deleting the topic file it points to: You just press DELETE on the TOC entry and then in the dialog displayed you uncheck the option for deleting the associated topic file.I don't even know if it is POSSIBLE to create this type of link easily when normally using H&M. Is this something to be concerned about? Or just roll with it? I'm guessing best practice is for everything to be IN the TOC Tree?
The TOC is just a list of links pointing to topic files, that is all. The files are ALL in Topic Files, whether they have TOC entries or not. In HTML every topic is a separate file, so they can all be exported in HTML output formats whether they have a TOC entry or not. If they are not referenced in the TOC they can be displayed with a link in a topic, which is really just the same as linking to them from the TOC.
This is different in Word, PDF and also ePub and Kindle eBooks. Those are "print" formats that are effectively a single document, even though ePub and Kindle are actually HTML internally. In those formats, the TOC does not link to individual files, but to positions within the single file that is the entire documentation. Then it is not possible to have links to topics that are not in the TOC, because they cannot be in that single document.
Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.