{
isFunctionDefinition = false;
}
lastElementWasApply = false;
MathContainer mathContainer = null;
ASTNode parentASTNode = null;
boolean setMath = false;
if (contextObject instanceof MathContainer) {
mathContainer = (MathContainer) contextObject;
if (mathContainer.getMath() == null) {
setMath = true;
} else {
// because normal operator are written <operator/> in mathML and so the parent ASTNode is not any more the contextObject
parentASTNode = mathContainer.getMath();
// System.out.println("MathMLStaxParser : processStartElement parent type : " + parentASTNode.getType());
}
} else if (contextObject instanceof ASTNode) {
parentASTNode = ((ASTNode) contextObject);
mathContainer = parentASTNode.getParentSBMLObject();
// System.out.println("MathMLStaxParser : processStartElement parent type : " + parentASTNode.getType());
} else {
// Should never happen
logger.debug("processStartElement : !!!!!!!!!!! Should not have been here !!!!!!!!!!!");
logger.debug("processStartElement : contextObject.classname = " + contextObject.getClass().getName());
return null;
}
ASTNode astNode = new ASTNode(mathContainer);
astNode.setType(elementName);
if (setMath) {
mathContainer.setMath(astNode);
} else {
parentASTNode.addChild(astNode);
}
/*else if (astNode.isNumber() || astNode.isConstant() || astNode.getType().equals(ASTNode.Type.NAME)