Is there a way to rebuild the TOC after "Error while parsing tag "topic"?

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

Post Reply
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Is there a way to rebuild the TOC after "Error while parsing tag "topic"?

Unread post by Dave Gehman »

We have six topics that return the error, "Error while parsing tag 'topic.'"

We had some issues with GIT for version control and if I remember right, this error is sometimes resolved via incantations with the version control software.

However, the problem has become embedded in the server repository. I need to rebuild my local copy and then push it to the server repository.

Is there a way to rebuild the TOC? The topics exist (and are correct) in the H+M Topics folder?

Or is there a better strategy for reclaiming these topics?

(Meanwhile, after getting the above error message, I opened one of the problematic topics in Notepad++, selected all and clicked on copy, thinking that I could simply switch to the XML tab in Write and paste it it. However, selecting the XML tab in H+M caused "The application has triggered an error. We apologize for the inconvenience! Please help us to improve." -- with the message "List index out of bounds (-1)." I filled out the Error Report and sent it on its way).
User avatar
Tim Green
Site Admin
Posts: 23157
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Is there a way to rebuild the TOC after "Error while parsing tag "topic"?

Unread post by Tim Green »

Hi Dave,

In our experience this happens when SVN gets interrupted. It then leaves its plain-text placeholders between the tags, which naturally makes the XML totally not well-formed. All you need to do is edit the affected XML topic files in an editor and remove the placeholders. They're very easy to see if you set the editor to XML mode (for example the free Notepad++) -- they stand out like sore thumbs.
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.
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Re: Is there a way to rebuild the TOC after "Error while parsing tag "topic"?

Unread post by Dave Gehman »

Tim Green wrote: Wed Sep 01, 2021 6:42 am In our experience this happens when SVN gets interrupted. It then leaves its plain-text placeholders between the tags,
a - Does this hold true for GIT? We have moved away from SVN, which has not been involved in our version control since June of this year.

b - Which tags should I sift through? Or could the problematic code be anywhere?

c - Can you give me an example of the plain text kind of thing I should be searching for?

For one of the problematic topics, Notepad++ does show two lines that are bracketed by <? .... ?> where the angles and questionmarks are red and highlighted in yellow:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>

However, similar sets of 2 lines appear at the beginning of topics that open just fine...
User avatar
Tim Green
Site Admin
Posts: 23157
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Is there a way to rebuild the TOC after "Error while parsing tag "topic"?

Unread post by Tim Green »

Hi Dave,

If it's not SVN I have no idea what you would be looking for, but it's quite possible that they add placeholders as well. As I said, they are always immediately recognizable, because they are just plain text between the tags, with no tags around them. Just look in the affected Topic XML files, as I suggested.

Another mess that version control sometimes makes is to add a copy of some of the entries in the TOC file AFTER the closing </map> tag. Look in the XML table of contents files in the \Maps folder. If there is anything after the closing </map> tag just delete it -- that should always be the end of the TOC file and anything that comes after it is spurious.
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.
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Re: Is there a way to rebuild the TOC after "Error while parsing tag "topic"?

Unread post by Dave Gehman »

Tim Green wrote: Wed Sep 01, 2021 10:56 am As I said, they are always immediately recognizable, because they are just plain text between the tags, with no tags around them. Just look in the affected Topic XML files, as I suggested.
Well, yes, I'm looking at the affected topic. Sorry to be dense, but how can plain text be between tags, yet have no tags around them? Do you mean on a tagless line in the code?

I do see a tagless line with 8 equals signs (========) that is not in one of the topics that's OK...
Another mess that version control sometimes makes is to add a copy of some of the entries in the TOC file AFTER the closing </map> tag. Look in the XML table of contents files in the \Maps folder. If there is anything after the closing </map> tag just delete it -- that should always be the end of the TOC file and anything that comes after it is spurious.
Nothing after </map> in table_of_contents.xml in the Maps folder.
User avatar
Tim Green
Site Admin
Posts: 23157
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Is there a way to rebuild the TOC after "Error while parsing tag "topic"?

Unread post by Tim Green »

I do see a tagless line with 8 equals signs (========) that is not in one of the topics that's OK...
That's your problem, delete it. There are likely to be other similar things. Anything not enclosed in tags is forbidden in XML. If you're using Notepad++ select Plugins Admin. in the Plugins menu and install the "XML Tools" plugin. That will tell you where there are syntax errors in XML files automatically.
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.
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Re: Is there a way to rebuild the TOC after "Error while parsing tag "topic"?

Unread post by Dave Gehman »

Thanks, once again, for the handholding.
Post Reply