try
{
- content = doc.getElementById("seqData");
+ 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);
}
- JSONFile jsonFile = new JSONFile().parse(new StringReader(content
+ JSONFile jsonFile = new JSONFile().parse(new StringReader(
+ contentFromDiv ? content.text() : content
.val()));
this.seqs = jsonFile.getSeqs();
this.seqGroups = jsonFile.getSeqGroups();