private void processAttributes(final String qName, final Attributes atts, final AttributesImpl res) {
        final int attsLen = atts.getLength();
        for (int i = 0; i < attsLen; i++) {
            final QName attQName = new QName(atts.getURI(i), atts.getLocalName(i));
            final String origValue = atts.getValue(i);
            String attValue = origValue;
            if (ATTRIBUTE_NAME_CONREF.equals(attQName.getLocalPart())) {
                attValue = replaceHREF(QName.valueOf(ATTRIBUTE_NAME_CONREF), atts).toString();
            } else if (ATTRIBUTE_NAME_HREF.equals(attQName.getLocalPart()) || ATTRIBUTE_NAME_COPY_TO.equals(attQName.getLocalPart())) {
                if (atts.getValue(ATTRIBUTE_NAME_SCOPE) == null ||
                        atts.getValue(ATTRIBUTE_NAME_SCOPE).equals(ATTR_SCOPE_VALUE_LOCAL)) {
                    attValue = replaceHREF(attQName, atts).toString();
                }
            } else if (ATTRIBUTE_NAME_FORMAT.equals(attQName.getLocalPart())) {
                final String format = atts.getValue(ATTRIBUTE_NAME_FORMAT);
                final String scope = atts.getValue(ATTRIBUTE_NAME_SCOPE);
                // verify format is correct
                if (isFormatDita(format) && (scope == null || scope.equals(ATTR_SCOPE_VALUE_LOCAL))) {
                    attValue = ATTR_FORMAT_VALUE_DITA;
                    if (!format.equals(ATTR_FORMAT_VALUE_DITA)) {
                        XMLUtils.addOrSetAttribute(res, DITA_OT_NS, ATTRIBUTE_NAME_ORIG_FORMAT, DITA_OT_NS_PREFIX + ":" + ATTRIBUTE_NAME_ORIG_FORMAT, "CDATA", format);
                    }
                }
            } else {
                attValue = getAttributeValue(qName, attQName, attValue);
            }
            XMLUtils.addOrSetAttribute(res, atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), attValue);
        }
    }
private void processAttributes ( final String qName , final Attributes atts , final AttributesImpl res ) { final int attsLen = atts . getLength ( ) ; for ( int i = 0 ; i < attsLen ; i ++ ) { final QName attQName = new QName ( atts . getURI ( i ) , atts . getLocalName ( i ) ) ; final String origValue = atts . getValue ( i ) ; String attValue = origValue ; if ( ATTRIBUTE_NAME_CONREF . equals ( attQName . getLocalPart ( ) ) ) { attValue = replaceHREF ( QName . valueOf ( ATTRIBUTE_NAME_CONREF ) , atts ) . toString ( ) ; } else if ( ATTRIBUTE_NAME_HREF . equals ( attQName . getLocalPart ( ) ) || ATTRIBUTE_NAME_COPY_TO . equals ( attQName . getLocalPart ( ) ) ) { if ( atts . getValue ( ATTRIBUTE_NAME_SCOPE ) == null || atts . getValue ( ATTRIBUTE_NAME_SCOPE ) . equals ( ATTR_SCOPE_VALUE_LOCAL ) ) { attValue = replaceHREF ( attQName , atts ) . toString ( ) ; } } else if ( ATTRIBUTE_NAME_FORMAT . equals ( attQName . getLocalPart ( ) ) ) { final String format = atts . getValue ( ATTRIBUTE_NAME_FORMAT ) ; final String scope = atts . getValue ( ATTRIBUTE_NAME_SCOPE ) ; if ( isFormatDita ( format ) && ( scope == null || scope . equals ( ATTR_SCOPE_VALUE_LOCAL ) ) ) { attValue = ATTR_FORMAT_VALUE_DITA ; if ( ! format . equals ( ATTR_FORMAT_VALUE_DITA ) ) { XMLUtils . addOrSetAttribute ( res , DITA_OT_NS , ATTRIBUTE_NAME_ORIG_FORMAT , DITA_OT_NS_PREFIX + ":" + ATTRIBUTE_NAME_ORIG_FORMAT , "CDATA" , format ) ; } } } else { attValue = getAttributeValue ( qName , attQName , attValue ) ; } XMLUtils . addOrSetAttribute ( res , atts . getURI ( i ) , atts . getLocalName ( i ) , atts . getQName ( i ) , atts . getType ( i ) , attValue ) ; } }
Process attributes

@param qName element name
@param atts input attributes
@param res attributes to write to