XML2 - Find the Maximum Depth

  • + 0 comments

    Im so upset i couldnt find any oneliner able to work ..

    def depth(elem, level= 0):
        global maxdepth
        [depth(e,level+1) for e in elem]
        maxdepth = max(maxdepth, level + 1)