View Single Post
Old 10-01-2020, 04:55 AM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,774
Karma: 6000000
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Thasaidon View Post
Checked and it makes no difference.

As requested I have exported an OPF from one of the books and attached it to the post. If I have done it right.
Yes, but I think still valid so this may be a bug in Sigil's opf parser.

In that opf they define a new namespace prefix ns0 that they assign for the default opf namespace and then therefore have to use it everywhere. Certainly not the most concise representation and notation but not incorrect xml as far as I can see.

This confuses the internal Sigil opf parser so I will have to fix that.

You can workaround this bug by doing the following to a copy of the opf file in any text editor. Ignore the single quotes, they are there just to delimit the strings.

1. Remove the unneeded prefix definition in the package tag by replacing

'xmlns:ns0="http://www.idpf.org/2007/opf"'

with:

'xmlns="http://www.idpf.org/2007/opf"'

2. remove the no longer needed prefix from the tag names by replacing all:

'<ns:'

with:

'<'

3. remove the no longer needed prefix from tag attributes by replacing all (notice the leading blank)

' ns0:'

with a single blank:

' '

Then save the changed opf and use it to replace the original one inside the epub zip.

I will work on tracking down why the lxml parser we use for pure xml files like the opf does not seem to simplify things properly.
KevinH is online now   Reply With Quote