def noContent (treeNode): contentNode = TreeUtils.bredthSearch(treeNode, lambda x: x[0][0] == "ContentSpec") if contentNode: emptyNode = TreeUtils.depthSearch(contentNode, lambda x: x[0][0] == "EMPTY") if emptyNode: return 1 return 0 return 1
def getElementAttributes (parseNode): """getElementAttributes """ attributeList = [] attlistNode = TreeUtils.bredthSearch(parseNode, lambda x: x[0][0] == "AttlistDecl") if attlistNode: for attDef in attlistNode[1]: attNameNode = TreeUtils.depthSearch(attDef, lambda x: x[0][0] == "Name") attributeList.append(attNameNode[0][1]) return attributeList