Comments in XML are deleted??

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

Moderators: Alexander Halser, Tim Green

Comments in XML are deleted??

Unread postby Christian Kessner » Thu May 03, 2018 3:05 pm

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?
Christian Kessner
 
Posts: 21
Joined: Wed Nov 30, 2016 9:07 am

Re: Comments in XML are deleted??

Unread postby Tim Green » Thu May 03, 2018 4:17 pm

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.
User avatar
Tim Green
Site Admin
 
Posts: 19936
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany


Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: No registered users and 4 guests

cron