Skip to content

Commit

Permalink
Update LODEParser.java
Browse files Browse the repository at this point in the history
  • Loading branch information
vChavezB authored Dec 15, 2023
1 parent 128a9f4 commit 8e7e72a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/java/widoco/LODEParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,18 @@ public String getRules() {
public String getRuleList() {
return ruleList;
}

private static String convertW3CDocumentToHtml(Document w3cDoc) {
try {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
StringWriter writer = new StringWriter();
transformer.transform(new DOMSource(w3cDoc), new StreamResult(writer));
return writer.toString();
} catch (Exception e) {
e.printStackTrace();
return "Error converting W3C Document to HTML";
}
}
public static String addImagesToEntities(String html, String rulesPath) {
org.jsoup.nodes.Document jsoupDoc = Jsoup.parse(html);
Document w3cDoc = convertToW3CDocument(jsoupDoc);
Expand Down

0 comments on commit 8e7e72a

Please sign in to comment.