Suddenly- a number of "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

Suddenly- a number of "Error while parsing tag "Topic""

Unread post by Dave Gehman »

I have a fair number topics (haven't searched them all out) that when selected in the Project Explorer, up pops "Error parsing tag "topic"."

What causes this?

I've found a 2008 posting here from thread viewtopic.php?f=22&t=8191 from paulororke that reads
I found the same issue on a few topics. For me things were fixed by using the context menu on the topic TOC entry to "Edit Caption".

After making changes to the caption, saving then syncing to my SVN I noticed quite a few topics being updated, after which the error went away.

I just thought I'd share that in case anyone else comes across this.
Unfortunately, I'm not sure what action Paul is recommending -- is the "context menu" the one that pops up upon right-click on the topic? I don't have a caption and I don't see an option to Edit Caption.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Suddenly- a number of "Error while parsing tag "Topic""

Unread post by Tim Green »

This is a known issue and is actually easy to correct. You will also see this in uncompressed projects. What happens is that in some rare cases a copy of some TOC entries is inserted incorrectly after the closing </map> tag in the main TOC file when you do copy and paste operations with the mouse between multiple TOCs. Unfortunately we have never been able to reproduce it ourselves, so it hasn't been possible to debug it yet.

Here is how to fix it:
  1. If the project isn't saved in uncompressed HMXP format select Save As... in the File menu and save it uncompressed in an empty folder.
  2. Open the main TOC file (the one without a number) in the \Maps folder in a code editor like Notepad++ and search for the FIRST closing </map> tag.
  3. If there are any lines of code after that tag DELETE them all and save.
  4. Repeat 2 and 3 for all other TOC files just to be sure.
  5. Open the repaired project and check through the TOCs
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: Suddenly- a number of "Error while parsing tag "Topic""

Unread post by Dave Gehman »

Unfortunately, we don't have anything text or code after the first (and only) </map> tags either in the un-numbered table_of_contents.xml or the only alternate, table_of_contents1.xml.

Is there an alternative tactic to try?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Suddenly- a number of "Error while parsing tag "Topic""

Unread post by Tim Green »

Hi Dale,

Another possible cause of this is that you are managing your project in SVN and the version control system didn't complete its merging and diffing procedures cleanly. When this happens it leaves its placeholders between the regular XML tags and the check for XML well-formedness then fails. You can usually fix this by opening the affected topics in Help+Manual, making any small change and then saving. HM will then automatically eliminate anything not in the XML schema.
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: Suddenly- a number of "Error while parsing tag "Topic""

Unread post by Dave Gehman »

(Probably of no importance around your answer -- we use GIT -- but the version control updating problem may likely be the issue.)

Meanwhile, where does the 'check for XML well-formedness' happen? In SVN/GIT or in H+M?
Last edited by Dave Gehman on Mon Mar 01, 2021 4:20 pm, edited 1 time in total.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Suddenly- a number of "Error while parsing tag "Topic""

Unread post by Tim Green »

Dave Gehman wrote: Mon Mar 01, 2021 4:16 pm Meanwhile, where does the 'check for XML well-formedness' happen? In SVN/GIT or in H+M?
HM checks every topic when it opens it and when it saves it. However, any XML-aware system will also perform this check before manipulating the XML. When it tries to read HM topics, for example, it would check everything it does against the .xsd file containing the HM XML schema, that is included in every HM project.
(Probably of no importance around your answer -- we use GIT -- but the updating problem may likely be the issue.)
It will either be that or something else external that has left something in the XML that shouldn't be there. In most cases it will be very obvious if you look at the XML topic files in an editor. There will be stuff between the tags that clearly doesn't belong there.
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: Suddenly- a number of "Error while parsing tag "Topic""

Unread post by Dave Gehman »

Thanks. We -- mere authors, not version control experts -- are scouring our company for someone who knows GIT and can help us out. Your answers (hopefully) will be pushing us in the right direction(s)...
Dave Gehman
Posts: 575
Joined: Sat Sep 23, 2017 9:05 pm

Re: Suddenly- a number of "Error while parsing tag "Topic""

Unread post by Dave Gehman »

Yep - got help to obtain a new GIT 'pull' (download from server repository) and the problem seems to have disappeared.

Thanks for the guidance.
Post Reply