public void split() throws LaudatioException
  {
    if (!outputDirectory.isDirectory() && !outputDirectory.mkdirs())
    {
      throw new LaudatioException(messages.getString(
        "COULD NOT CREATE OUTPUT DIRECTORY."));
    }

    // check if input file exits
    if (!inputFile.isFile())
    {
      throw new LaudatioException(messages.
        getString("INPUT FILE DOES NOT EXIST"));
    }

    // read in file
    SAXBuilder sax = new SAXBuilder();
    try
    {
      Document doc = sax.build(inputFile);
      
      TEIValidator.Errors errors = new TEIValidator.Errors();
     
      errors.putAll(extractMainCorpusHeader(doc));
      errors.putAll(extractDocumentHeaders(doc));
      errors.putAll(extractPreparationSteps(doc));
      
      if(!errors.isEmpty())
      {
        System.out.println(TEIValidator.formatParserExceptions(errors));
        throw new LaudatioException("Source document was invalid");
      }

    }
    catch (JDOMException ex)
    {
      throw new LaudatioException(ex.getLocalizedMessage());
    }
    catch (SAXException ex)
    {
      throw new LaudatioException(TEIValidator.getSAXParserError(ex));
    }
    catch (IOException ex)
    {
      throw new LaudatioException(ex.getLocalizedMessage());
    }
  }