This page outlines some more generic styling that should apply to configuration in order to keep it nice and readable.
XML elements
XML elements with no content should use the self-closing syntax.
The following example shows an attribute element which has content (a child element) and textValue element which is self-closing.
<attribute attribute="MyContentLessAttributeElement">
<textValue type="label" text="Look, no closing tag as I'm self closing :)"/>
</attribute>
Spacing
Indentations
Two spaces are used as a single indent.
XML child elements should be indented one level from their parent element.
Blank lines
Use blank lines to separate sections of configuration so things remain clear.
For example a blank line should follow the last <parameter/> element of a component or form fragment before.
In components, a blank line should separate sections of other top-level XML elements such as labels or data constraints when included.
As with code standards, configuration line comments should tend to have a blank line above them (although not a hard-and-fast rule).
Example
Below is an example of a well formatted component, adhering to naming conventions, indent, spacing and other style guide rules.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catcfg:Configuration xmlns="http://www.fostermoore.com/schema/cat-ng"
xmlns:catcfg="http://www.fostermoore.com/schema/catcfg-ng"
xmlns:platform="http://www.fostermoore.com/schema/catalyst-platform/v1"
xmlns:text="http://www.fostermoore.com/schema/catalyst-text/v1">
<components>
<component name="MyComponent">
<parameter name="requiredParam"/>
<parameter name="otherRequiredParam"/>
<parameter name="baseTextKeyPrefix" default="myComponent"/>
<parameter name="optionalParam" default="defaultValue"/>
<parameter name="handler" default="/components/folder/MyComponentHandler.groovy"/>
<box shortCode="component" textKeyPrefix="${baseTextKeyPrefix}">
<attribute attribute="MyAttribute" textKeyPrefix="${baseTextKeyPrefix}.myAttribute"/>
<!-- Keep logical "sections" nice and clear using blank line spaces -->
<box shortCode="subSection">
<rule scope="*" methodName="onRule" resourceName="${handler}"/>
<attribute attribute="MyStatusAttribute" visible="false" textKeyPrefix="${baseTextKeyPrefix}.myStatusAttribute" defaultValue="pending">
<platform:set-attribute-value scope="activate" value="registered" when-attribute-value-equals="pending"/>
</attribute>
</box>
</box>
</component>
</components>
<locales>
<locale name="en">
<text key="myComponent.label">My component</text>
<text key="myComponent.myAttribute.label">My attribute</text>
<text key="myComponent.myStatusAttribute.label">Status</text>
</locale>
</locales>
</catcfg:Configuration>

