@Override
    public void startElement(final String uri, final String localName, final String name,
            final Attributes atts) throws SAXException {
        if (ignoreDepth > 0) {
            ignoreDepth++;
            return;
        }

        if (PR_D_CODEREF.matches(atts)) {
            ignoreDepth++;
            try {
                final URI hrefValue = toURI(atts.getValue(ATTRIBUTE_NAME_HREF));
                if (hrefValue != null) {
                    final File codeFile = getFile(hrefValue);
                    if (codeFile != null && codeFile.exists()) {
                        logger.debug("Resolve coderef " + codeFile);
                        final Charset charset = getCharset(atts.getValue(ATTRIBUTE_NAME_FORMAT));
                        final Range range = getRange(hrefValue);
                        try (BufferedReader codeReader = new BufferedReader(
                                new InputStreamReader(new FileInputStream(codeFile), charset))) {
                            range.copyLines(codeReader);
                        } catch (final Exception e) {
                            logger.error("Failed to process code reference " + codeFile, e);
                        }
                    } else {
                        logger.warn(MessageUtils.getMessage("DOTJ051E", hrefValue.toString()).setLocation(atts).toString());
                    }
                } else {
                    //logger.logDebug("Code reference target not defined");
                }
            } catch (final Exception e) {
                logger.error(e.getMessage(), e) ;
            }
        } else {
            super.startElement(uri, localName, name, atts);
        }
    }
@ Override public void startElement ( final String uri , final String localName , final String name , final Attributes atts ) throws SAXException { if ( ignoreDepth > 0 ) { ignoreDepth ++ ; return ; } if ( PR_D_CODEREF . matches ( atts ) ) { ignoreDepth ++ ; try { final URI hrefValue = toURI ( atts . getValue ( ATTRIBUTE_NAME_HREF ) ) ; if ( hrefValue != null ) { final File codeFile = getFile ( hrefValue ) ; if ( codeFile != null && codeFile . exists ( ) ) { logger . debug ( "Resolve coderef " + codeFile ) ; final Charset charset = getCharset ( atts . getValue ( ATTRIBUTE_NAME_FORMAT ) ) ; final Range range = getRange ( hrefValue ) ; try ( BufferedReader codeReader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( codeFile ) , charset ) ) ) { range . copyLines ( codeReader ) ; } catch ( final Exception e ) { logger . error ( "Failed to process code reference " + codeFile , e ) ; } } else { logger . warn ( MessageUtils . getMessage ( "DOTJ051E" , hrefValue . toString ( ) ) . setLocation ( atts ) . toString ( ) ) ; } } else { } } catch ( final Exception e ) { logger . error ( e . getMessage ( ) , e ) ; } } else { super . startElement ( uri , localName , name , atts ) ; } }
XMLFilter methods -------------------------------------------------------