Project

Profile

Help

Revision c1cc9bd8

Added by O'Neil Delpratt 5 months ago

Saxon/C bug fix to #4848 and #4847. Also some development work

View differences:

latest10/hec/Saxon.C.API/python-saxon/saxonc.pyx
3393 3393
        """
3394 3394
        cdef const char* c_string = self.thisvptr.toString()
3395 3395
        ustring = c_string.decode('UTF-8') if c_string is not NULL else None
3396
        return ustring 
3396
        return ustring
3397

  
3398
     def __iter__(self):
3399
        ''' Returns the Iterator object of PyXdmValue'''
3400
        return PyXdmValueIterator(self)
3401

  
3402
cdef class PyXdmValueIterator:
3403
     ''' Iterator class for the PyXdmValue '''
3404
     def __init__(self, value):
3405
     # PyXdmValue object reference
3406
        self._value = value
3407
        # member variable to keep track of current index
3408
       self._index = 0
3409
   def __next__(self):
3410
       ''''Returns the next value from PyXdmValue object's lists '''
3411
       if self._index < self._value.size :
3412
           result = value.item_at(self._index)
3413
           self._index +=1
3414
           return result
3415
       # End of Iteration
3416
       raise StopIteration
3417

  
3418

  
3397 3419

  
3398 3420
cdef class PyXdmItem(PyXdmValue):
3399 3421
     cdef saxoncClasses.XdmItem *derivedptr      # hold a C++ instance which we're wrapping

Also available in: Unified diff