Package org.dom4j

Examples of org.dom4j.DocumentException


  private void callNativeHtmlParser( byte[] htmlBytes, String htmlEncoding, boolean forceAcceptMeta )
    throws ParserException, DocumentException
  {
    if (htmlBytes.length > htmlSizeLimit)
    {
      throw new DocumentException("Html too long:" + htmlBytes.length +">" + this.htmlSizeLimit);
    }

    //html = html.replaceAll("<\\s*(STYLE|style|script|SCRIPT)\\s*>", "<$1 harmless=''> ");

    this.instructionsPool = new InstructionsPool(16 + (htmlBytes.length / 10));
    try
    {
      this.parseHtml( htmlBytes, htmlEncoding, forceAcceptMeta );
    }
    catch( ParserException e )
    {
      throw e;
    }
    catch( Throwable e )
    {
      System.err.println(Thread.currentThread() + "Warning: could not parse html :" + e.toString());
      throw new DocumentException(e);
    }
  }
View Full Code Here


  public Document modify(File source) throws DocumentException {
    try {
      return installModifyReader().read(source);
    } catch (SAXModifyException ex) {
      Throwable cause = ex.getCause();
      throw new DocumentException(cause.getMessage(), cause);
    }
  }
View Full Code Here

  public Document modify(InputSource source) throws DocumentException {
    try {
      return installModifyReader().read(source);
    } catch (SAXModifyException ex) {
      Throwable cause = ex.getCause();
      throw new DocumentException(cause.getMessage(), cause);
    }
  }
View Full Code Here

  public Document modify(InputStream source) throws DocumentException {
    try {
      return installModifyReader().read(source);
    } catch (SAXModifyException ex) {
      Throwable cause = ex.getCause();
      throw new DocumentException(cause.getMessage(), cause);
    }
  }
View Full Code Here

      throws DocumentException {
    try {
      return installModifyReader().read(source);
    } catch (SAXModifyException ex) {
      Throwable cause = ex.getCause();
      throw new DocumentException(cause.getMessage(), cause);
    }
  }
View Full Code Here

  public Document modify(Reader source) throws DocumentException {
    try {
      return installModifyReader().read(source);
    } catch (SAXModifyException ex) {
      Throwable cause = ex.getCause();
      throw new DocumentException(cause.getMessage(), cause);
    }
  }
View Full Code Here

      throws DocumentException {
    try {
      return installModifyReader().read(source);
    } catch (SAXModifyException ex) {
      Throwable cause = ex.getCause();
      throw new DocumentException(cause.getMessage(), cause);
    }
  }
View Full Code Here

  public Document modify(URL source) throws DocumentException {
    try {
      return installModifyReader().read(source);
    } catch (SAXModifyException ex) {
      Throwable cause = ex.getCause();
      throw new DocumentException(cause.getMessage(), cause);
    }
  }
View Full Code Here

  public Document modify(String source) throws DocumentException {
    try {
      return installModifyReader().read(source);
    } catch (SAXModifyException ex) {
      Throwable cause = ex.getCause();
      throw new DocumentException(cause.getMessage(), cause);
    }
  }
View Full Code Here

      reader.setXMLWriter(getXMLWriter());
      reader.setXMLReader(getXMLReader());

      return reader;
    } catch (SAXException ex) {
      throw new DocumentException(ex.getMessage(), ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.dom4j.DocumentException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.