Comments in XML are deleted??

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
Christian Kessner
Posts: 30
Joined: Wed Nov 30, 2016 9:07 am

Comments in XML are deleted??

Unread post by Christian Kessner »

I just found out that when comments are added in the XML file (or, more specifically, if parts of the XML file are commented to test something), they are removed after the user changes to the editor view and back to the XML view.
In my case it worked out, because I indeed wanted to get rid of something and just wanted to see if it works, but it might be a problem in some cases?
User avatar
Tim Green
Site Admin
Posts: 23153
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Comments in XML are deleted??

Unread post by Tim Green »

I just found out that when comments are added in the XML file (or, more specifically, if parts of the XML file are commented to test something), they are removed after the user changes to the editor view and back to the XML view.
Absolutely. This is entirely intentional. 8) You cannot add anything to the XML that is not explicitly defined in the .xsd XML schema file included with every project (in HMXZ files it is inside the .hmxz, which is actually a zip). As you have discovered, it will just be removed silently.

XML may look a little like HTML but it is a completely different language. Actually, it is not a language at all, it is a method for defining languages of your own, and the HM XML language ("schema") is defined in the .xsd file. The benefit of XML is that it is 100% strict and error-intolerant. Even a single deviation from the defined syntax will make the entire file invalid. This is necessary because it needs to be absolutely dependable and known for HM to be able to use it as source for publishing to multiple formats.

There is a comment syntax that you can use. Just use the comment tool in Write > Insert Object, then have a look at the resulting XML. For full details, Help & Manual XML format is fully documented in the Helpman_XML_ref.chm file, which you can find in the Help & Manual program directory.
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.
Post Reply