JAXX conventions

From JAXXWiki

Certain conventions apply when writing JAXX code, just as with any other language.

Use single quotes

XML permits attribute values to be quoted with either single or double quotes. In JAXX, single quotes are generally preferable, because attribute values often include Java code and Java uses double quotes for strings. Double-quoted strings may appear in single-quoted attribute values without difficulty, but would have to be escaped in double-quoted attribute values.

Java also uses single quotes, but only for character constants, which appear far less often than strings.

Non-class tags are lowercase

Java conventions have always called for the first letter of a class name to be uppercase. As class tags are based on the name of the underlying class, this means that essentially all class tags will be uppercase (class tags which include a full package name will generally start with a lowercase character, but such tags are easy to recognize as being classes).

To distinguish them from class tags, all non-class tags should begin with lowercase letters.

Scripts should only appear under the root tag

Script tags may appear almost anywhere within a JAXX file, but they can be misleading in some cases.

<JPanel>
  <JButton label="Test">
    <script>
      public void paintComponent(Graphics g) {
          ...
      }
    </script>
  </JButton>
</JPanel>

This example appears to be overriding JButton.paintComponent(), but is actually overriding JPanel.paintComponent(). Avoid this situation by placing scripts under the root tag.