code: void buildAttribute(org.w3c.dom.Node item) throws InvalidInputException {
      switch (item.getNodeName()) {
        case CLASS_ATTR:
          attributes.put(CLASS_ATTR, getStringAttribute(item));
          break;
        case STYLE_ATTR:
          final String styleAttribute = getStringAttribute(item);
          Styles.validate(styleAttribute);
          attributes.put(STYLE_ATTR, styleAttribute);
          break;
        default:
          throw new InvalidInputException("Attribute \"" + item.getNodeName()
              + "\" is not allowed in \"" + getMessageMLTag() + "\"");
      }
    }
docs: Parse a DOM attribute into MessageML element properties.