private AttributesImpl validateLang(final Attributes atts, final AttributesImpl modified) throws SAXException {
        AttributesImpl res = modified;
        final String lang = atts.getValue(XML_NS_URI, "lang");
        if (lang != null) {
            final int i = lang.indexOf('_');
            if (i != -1) {
                if (processingMode == Mode.STRICT) {
                    throw new SAXException(MessageUtils.getMessage("DOTJ056E", lang).setLocation(locator).toString());
                }
                logger.error(MessageUtils.getMessage("DOTJ056E", lang).setLocation(locator).toString());
                if (processingMode == Mode.LAX) {
                    if (res == null) {
                        res = new AttributesImpl(atts);
                    }
                    res.setValue(res.getIndex(XML_NS_URI, "lang"), lang.replace('_', '-'));
                }
            }
        }
        return res;
    }
private AttributesImpl validateLang ( final Attributes atts , final AttributesImpl modified ) throws SAXException { AttributesImpl res = modified ; final String lang = atts . getValue ( XML_NS_URI , "lang" ) ; if ( lang != null ) { final int i = lang . indexOf ( '_' ) ; if ( i != - 1 ) { if ( processingMode == Mode . STRICT ) { throw new SAXException ( MessageUtils . getMessage ( "DOTJ056E" , lang ) . setLocation ( locator ) . toString ( ) ) ; } logger . error ( MessageUtils . getMessage ( "DOTJ056E" , lang ) . setLocation ( locator ) . toString ( ) ) ; if ( processingMode == Mode . LAX ) { if ( res == null ) { res = new AttributesImpl ( atts ) ; } res . setValue ( res . getIndex ( XML_NS_URI , "lang" ) , lang . replace ( '_' , '-' ) ) ; } } } return res ; }
Validate and fix {@code xml:lang} attribute.

@return modified attributes, {@code null} if there have been no changes