All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hl7.fhir.utilities.xhtml.XhtmlUtils Maven / Gradle / Ivy

There is a newer version: 6.4.1
Show newest version
package org.hl7.fhir.utilities.xhtml;

public class XhtmlUtils {

  public static String convertHtmlToText(String source, String desc) {
    try {
      XhtmlDocument doc = new XhtmlParser().parse(source, "html");
      return doc.getDocumentElement().allText();
    } catch (Exception e) {
      // todo - should we try another way?
      System.err.println("XHTML content could not be parsed from "+desc);
      e.printStackTrace();
      System.err.println(source);
      return "Unparseable HTML";
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy