I have been browsing some examples of avahi services files (XML format), and some of them had <!--*-nxml-*--> comment following the document type definition.For example:<?xml version=1.0 standalone='no'?><!--*-nxml-*--><!DOCTYPE service-group SYSTEM avahi-service.dtd><service-group>    <name replace-wildcards=yes>%h</name>    <service>        <type>_device-info._tcp</type>        <port>0</port>        <txt-record>model=RackMac</txt-record>    </service></service-group>After searching, I figured this tag purpose was to be interpreted by emacs for its nXML mode. But since I'm not an emacs user myself, this tag seems completely useless as it is.Is there any convention that says this should be the defaults for XML files (may be only configuration files), or does it has another hidden purpose I can't figure?
Is it considered good practice to use a nxml tag in xml conf files?
linux;configuration;emacs;xml
The XML comment <!--*-nxml-*--> will be ignored by any XML parser, so it has no function whatsoever in terms of the actual meaning or function of the XML from that point of view.It is only there to allow emacs to do correct highlighting etc.In vim, this is called a modeline, and would look like<!-- vim: set filetype=nxml.xml : -->In Emacs, this is called specifying file local variables, and the slightly longer (compared to what's in your file) format is<!-- -*- mode: modename; var: value;  -*- -->This is useful if the editor can't figure out the file's proper type in any other way (from the filename or by using some heuristic matching of the contents). Apart from that, it serves no purpose.There are no standards, no best practices and no recommendations that say this type of editor-specific comment needs to be added.