private Style getStyle(final char c, final ElementType elementType) {
        Style style = elementType.getStyle();

        if (elementType != ElementType.CONTENT) {
            if (elementType == ElementType.PI || elementType == ElementType.DOCTYPE) {
                if (c == '"') {
                    // Toggle attribute value flag.
                    inAttValue = !inAttValue;

                } else if (!inAttValue
                        && (c == '?' || c == '!' || c == '/' || c == ':' || c == '=' || c == '<' || c == '>')) {
                    style = Style.SYNTAX;
                }

            } else if (elementType == ElementType.COMMENT) {
                if (commentState == CommentState.START || commentState == CommentState.END) {
                    style = Style.SYNTAX;
                }

            } else {
                if (c == '"') {
                    // Toggle attribute value flag.
                    inAttValue = !inAttValue;
                    style = Style.ATTRIBUTE_VALUE;

                } else if (inAttValue) {
                    style = Style.ATTRIBUTE_VALUE;

                } else if (c == '/' || c == ':' || c == '=' || c == '<' || c == '>') {
                    style = Style.SYNTAX;

                } else {
                    if (!doneElementStyle && isWhitespace(c)) {
                        doneElementStyle = true;
                    }

                    if (doneElementStyle) {
                        style = Style.ATTRIBUTE_NAME;
                    }
                }
            }
        }

        return style;
    }
Gets the style type that is appropriate for the current char in the
current element type.

@param c           The current char.
@param elementType The current element type.
@return The appropriate style.
stroom-core-client-widget/src/main/java/stroom/editor/client/model/XMLStyler.java