- Element content = null;
- Document doc = null;
- try {
- StringBuilder htmlData = new StringBuilder();
- String currentLine;
- while ((currentLine = nextLine()) != null)
- {
- htmlData.append(currentLine);
- }
-
- doc = Jsoup.parse(htmlData.toString());
- } catch (OutOfMemoryError oom) {
- errormessage = "Not enough memory to process HTML document";
- throw new IOException(errormessage);
+ boolean contentFromDiv = true;
+ // search for BioJSON data in div element with id seqData
+ content = doc.select("div[id=seqData]").first();
+ if (content == null)
+ {
+ contentFromDiv = false;
+ // search for BioJSON data in input element with id seqData
+ content = doc.getElementById("seqData");
+ }
+
+ if (content == null)
+ {
+ errormessage = "The html document is not embedded with BioJSON data";
+ throw new IOException(errormessage);