def next(self):
        """
        Get the next item.

        @return: A tuple: the next (child, ancestry).
        @rtype: (L{SchemaObject}, [L{SchemaObject},..])
        @raise StopIteration: A the end.

        """
        frame = self.top()
        while True:
            result = frame.next()
            if result is None:
                self.pop()
                return self.next()
            if isinstance(result, Content):
                ancestry = [f.sx for f in self.stack]
                return result, ancestry
            self.push(result)
            return self.next()
def next ( self ) : frame = self . top ( ) while True : result = frame . next ( ) if result is None : self . pop ( ) return self . next ( ) if isinstance ( result , Content ) : ancestry = [ f . sx for f in self . stack ] return result , ancestry self . push ( result ) return self . next ( )
Get the next item.

        @return: A tuple: the next (child, ancestry).
        @rtype: (L{SchemaObject}, [L{SchemaObject},..])
        @raise StopIteration: A the end.