To make it a more official epubcfi, you would need to convert it to be:
epubcfi(/6/4!/4/4)
The first /6 tells it to find the 3rd tag child on the content.opf package tag, which is the spine, and then the /4 means to take the second tag child of the spine tag (the itemref for Section0001.xhtml). The ! means to follow the idref to access the correct file href in the manifest and redirect to it.
The remainder /4/4 from your cfi says to start with the html tag of the target file and take its 2nd tag child (body) and then the 2nd tag child of the body tag which is the line with the p tag with the epub:type="dedication" attribute.
If a node path ends with a n odd node number, it means it is a text node and a character offset into the text would be added after a : .
So for example, an epubcfi(/6/4/4/4/1:10) should point to the "d" in the word "dedication" in the text node with the string "This is a dedication."
Hope this helps.
KevinH
Quote:
Originally Posted by Doitsu
I still don't fully understand the epubcfi format. For example, for a test epub3 book that I created ACE reported the following non-standard epubcfi:
Code:
Text/Section0001.xhtml#epubcfi(/4/4)
The actual Section0001.xhtml HTML code is:
Assuming that Section0001.xhtml is the second spine entry, how would I need to reformat the above non-standard ACE epubcfi for use with your code?
The actual spine looks like this:
|