use of org.loboevolution.html.js.xml.XMLDocument in project LoboEvolution by LoboEvolution.
the class DOMParserImpl method parseFromString.
/**
* {@inheritDoc}
*/
@Override
public Document parseFromString(String html, String type) {
Element element = document.createElement("DIV");
element.setInnerHTML(html);
if (!"text/html".equals(type) && !"text/xml".equals(type) && !"application/xml".equals(type) && !"application/xhtml+xml".equals(type) && !"image/svg+xml".equals(type)) {
throw Context.reportRuntimeError("Invalid 'type' parameter: " + type);
}
XMLDocument document = new XMLDocument();
document.loadXML(element.getInnerHTML());
return document;
}
Aggregations