public void startElement(final String uri, final String localName, final String qName, final Attributes attributes)
        throws SAXException
    {
        String name = qName;
        if ((name == null) || (name.length() == 0))
        {
            name = localName;
        }

        if (name.equals(ELEMENT_DICE_MACROS))
        {
        }
        else if (name.equals(ELEMENT_DICE_MACRO))
        {
            final String macroName = attributes.getValue(ATTRIBUTE_NAME);

            if ((macroName == null) || (macroName.length() == 0))
            {
                error(new SAXParseException("Macro tag without " + ATTRIBUTE_NAME + " attribute, skipping...", locator));
                return;
            }

            final String macroDefinition = attributes.getValue(ATTRIBUTE_DEFINITION);
            if ((macroDefinition == null) || (macroDefinition.length() == 0))
            {
                error(new SAXParseException("Macro tag without " + ATTRIBUTE_DEFINITION + " attribute, skipping...",
                    locator));
                return;
            }

            final DiceMacro macro = new DiceMacro(macroDefinition, macroName, null);
            if (!macro.isInitialized())
            {
                error(new SAXParseException("Unable to parse macro " + macroName + ": " + macroDefinition, locator));
                return;
            }

            macros.add(macro);
        }
    }