This is the action performed when an end tag is read. The action consists in colecting all the dubiosElements(elements without an end tag). They are considered dubious because we don't know if they are empty or may be closed... Only the DTD can provide this information. We don't have a DTD so we wil
(String elemName)
| 548 | * @param elemName is the the name of the end tag that was read |
| 549 | */ |
| 550 | private void performActionWithEndElem(String elemName) { |
| 551 | CustomObject obj = null; |
| 552 | boolean stop = false; |
| 553 | |
| 554 | // get all the elements that are dubious from the stack |
| 555 | // the iteration will stop when an element is equal with elemName |
| 556 | while (!stack.isEmpty() && !stop){ |
| 557 | |
| 558 | // eliminate the object from the stack |
| 559 | obj = stack.pop(); |
| 560 | |
| 561 | //if its elemName is equal with the param elemName we stop the itteration |
| 562 | if (obj.getElemName().equalsIgnoreCase(elemName)) stop = true; |
| 563 | |
| 564 | // otherwhise add the element to the doubiousElements list |
| 565 | else dubiousElements.add(obj); |
| 566 | } |
| 567 | }//performActionWithEndElem |
| 568 | |
| 569 | /** |
| 570 | * This method is called after we read the entire SGML document |