public List<TextMarker> loadTextMarkerList(VFSLeaf textMarkerFile) {
if (textMarkerFile == null) {
// filename not defined at all
return new ArrayList<TextMarker>();
}
XMLParser parser = new XMLParser();
InputStream stream = textMarkerFile.getInputStream();
if (stream == null) {
// e.g. file was removed
return new ArrayList<TextMarker>();
}
Document doc = parser.parse(stream, false);
Element root = doc.getRootElement();
if (root == null) {
// file was empty;
return new ArrayList<TextMarker>();
}