streamcorpus_pipeline/offsets.py
def xpath_offset(self):
        '''Returns a tuple of ``(xpath, character offset)``.

        The ``xpath`` returned *uniquely* identifies the end of the
        text node most recently inserted. The character offsets
        indicates where the text inside the node ends. (When the text
        node is empty, the offset returned is `0`.)
        '''
        datai = self.depth_stack[-1].text_index()
        xpath = (u'/' +
                 u'/'.join(dse.xpath_piece()
                           for dse in self.depth_stack[:-1]) +
                 (u'/text()[%d]' % datai))
        return (xpath, self.data_start)
def xpath_offset(self):
        '''Returns a tuple of ``(xpath, character offset)``.

        The ``xpath`` returned *uniquely* identifies the end of the
        text node most recently inserted. The character offsets
        indicates where the text inside the node ends. (When the text
        node is empty, the offset returned is `0`.)
        '''
        datai = self.depth_stack[-1].text_index()
        xpath = (u'/' +
                 u'/'.join(dse.xpath_piece()
                           for dse in self.depth_stack[:-1]) +
                 (u'/text()[%d]' % datai))
        return (xpath, self.data_start)
Returns a tuple of ``(xpath, character offset)``.

        The ``xpath`` returned *uniquely* identifies the end of the
        text node most recently inserted. The character offsets
        indicates where the text inside the node ends. (When the text
        node is empty, the offset returned is `0`.)