I would like to know if there are any xml coding standards.
<?xml version="1.0"?>
<overlay id="tutorboy-toolbar-Overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<toolbox id="navigator-toolbox">
<toolbar id="tutorboy-toolbar-Toolbar"
toolbarname="TutorBoy Toolbar"
accesskey="T"
class="chromeclass-toolbar"
context="toolbar-context-menu"
hidden="false"
persist="hidden">
<toolbarbutton label="TutorBoy"
id="tutorboy-toolbar-button-home"
accesskey="d"
image="chrome://tutorboy-toolbar/skin/logo.png"
oncommand="loadURL('http://tutorboy.com');"
tooltiptext="Click here to go to the Tutorboy.com homepage." />
is this way of arrangement allowed?
The W3C defines an XML specification recommendation:
http://www.w3.org/TR/REC-xml/
Since you’ve narrowed your question to XML formatting, there’s no “universal” answer to how your XML should be formatted. Beyond conforming to whatever DTD or schema you happen to be dealing with, the importance of particular spacing/indentation of your tags lies with the people who will be dealing with your data.
If you’re creating XML data to be sent across a network as part of a web service or some sort, then generally you’re going to want to eliminate any unnecessary whitespace before transfer in order to optimize your data transfer rate. This means no line breaks, no indentation, no comments.
If your creating an XML document that others will be reading/modifying on a regular basis, then obviously you’ll want to put some consideration into keeping the document readable. What constitutes “readable” is determined by everyone involved on that particular team or project.