MCPcopy Create free account
hub / github.com/GateNLP/gate-core / performActionWithEndElem

Method performActionWithEndElem

src/main/java/gate/sgml/Sgml2Xml.java:550–567  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 2

doState12Method · 0.95
doState13Method · 0.95

Calls 4

getElemNameMethod · 0.95
popMethod · 0.80
addMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected