Thread: CFI Parser
View Single Post
Old 01-13-2019, 10:29 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,580
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Not sure what you are asking. The parser does not care if the first step is a spine reference or not, for instance to parse

Code:
epubcfi(/4[idParaDest-e]/2/4[toc])
you simply call parse_epubcfi()

which will give you:

Code:
({u'steps': [{u'id': u'idParaDest-e', u'num': 4},
   {u'num': 2},
   {u'id': u'toc', u'num': 4}]},
 {},
 {},
 u'')
read the steps from the first returned value.
kovidgoyal is offline   Reply With Quote