code: @Override
      public void execute() throws BuildException {
          if (getProject() == null) {
              throw new BuildException(new IllegalStateException("Project not available"));
          }
          if (getProject().getProperty("document.locale") == null) {
              try {
  
                  documentPath = documentPath.replace(File.separatorChar, '/');
                  final File file = documentPath.startsWith("file:") ?
                          new File(new java.net.URI(documentPath)) :
                              new File(documentPath);
                          if (!file.exists()) {
                              throw new Exception("File does not exist");
                          }
                          if (!file.canRead()) {
                              throw new Exception("Can't read input file");
                          }
  
                          final SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
                          final SAXParser saxParser = saxParserFactory.newSAXParser();
  
                          saxParser.parse(file, new DefaultHandlerImpl());
  
              } catch (final StopParsingException e) {
                  log("Lang search finished", Project.MSG_INFO);
              } catch (final Exception e) {
                  throw new BuildException("Failed to read document language: " + e.getMessage(), e);
              }
          }
          final String locale = getProject().getProperty("document.locale");
          if (locale != null && getProject().getProperty("document.language") == null) {
              setActiveProjectProperty("document.language",
                      locale.substring(0, locale.length() < 2 ? locale.length(): 2));
          }
      }
docs: Executes the Ant task.