display comments from xml
This commit is contained in:
@@ -5,7 +5,7 @@ class Model {
|
||||
let parser = new DOMParser();
|
||||
let xmlDoc = parser.parseFromString(xml, "text/xml");
|
||||
|
||||
let comments = [];
|
||||
this.comments = [];
|
||||
|
||||
let comment = xmlDoc.getElementsByTagName("comment");
|
||||
for (let i = 0; i < comment.length; i++) {
|
||||
@@ -14,9 +14,9 @@ class Model {
|
||||
let text = comment[i].getElementsByTagName("text")[0].innerHTML;
|
||||
let fulltext = comment[i].getElementsByTagName("fulltext")[0].innerHTML;
|
||||
|
||||
comments.push(new Comment(start, end, text, fulltext));
|
||||
this.comments.push(new Comment(start, end, text, fulltext));
|
||||
}
|
||||
|
||||
return comments;
|
||||
return this.comments;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user