Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-02-2020, 09:39 PM   #16
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by KevinH View Post
As DiapDealer said. Thank you for your scrambled test case. Using the very latest build, I was easily able to open this epub in Sigil.

BTW, it still gave warnings but these are real warnings related to wrong media types for ttf fonts that have nothing to do with the extra namespace ns0: in the OPF.

The opf is now properly cleaned up on load.

So we should be good to go with the next release.

Thanks,

KevinH

ps here are those warnings:
Thank you.

Glad to be of service.

With regard to the

Quote:
The OPF uses an unrecognized media type "application/octet-stream" for file "LiberationSerif-Regular.ttf" - A temporary media type of "font/ttf" has been assigned. You should edit your OPF file to fix this problem.
problem. I know about this and routinely fix it when it crops up.

The OPF is one file I need to know more about. I understand the basic structure but I do not know the fine detail. How "nsO: was being used meant nothing to me.
Thasaidon is offline   Reply With Quote
Old 10-02-2020, 11:57 PM   #17
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,766
Karma: 6000000
Join Date: Nov 2009
Device: many
FWIW, pure xml allows any tags and attributes anyone would want. The problem is that two or more xml projects/language variants could use the same name for different tags that mean different things. And worse yet these names could needed to be used in the same xml file. So xml adopted the use of namespaces and these namespaces had to be unique so they decided to use a url/uri to represent them since no two different websites could have the same url. (These urls need not point to functional web pages but sometimes do).

The idea was to prefix each tag with its associated project namespace (url).. However that is too cumbersome in practice and shorter namespace prefixes were used instead. Things like opf: and dc: and even ns0: are examples of these shorter namespace prefixes.

Each prefix needs to be defined by using an xmlns attribute hopefully in the root tag and where else needed by using the xmlns attribute.

So the attribute: xmlns:opf="http://www.idpf.org/2007/opf" is often seen in opf files to define the namespace associated with the opf: prefix.

To make notation even shorter a tag can define a default namespace that tells you that all tags without prefixes are using this namespace. For example:
xmlns="http://www.idpf.org/2007/opf" means that the tags in the opf namespace do not need a prefix at all.

Your epub opf defined an uncommon prefix (ns0:) for tags in the opf namespace and then needed to prefix all tags with ns0: as a result.

This made the opf much more cumbersome than usual.

Sigil's code knows the urls associated with epub namespaces and now properly simplifies (cleans) them down to the most compact (typical) form so that they can be more easily be read, written, and parsed.

Hope something here helps.
KevinH is online now   Reply With Quote
Old 10-03-2020, 12:37 AM   #18
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,251
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by KevinH View Post
Sigil's code knows the urls associated with epub namespaces and now properly simplifies (cleans) them down to the most compact (typical) form so that they can be more easily be read, written, and parsed.

Hope something here helps.
Oh, ghod! A return to the days when Sigil automatically changed the directory structure of an epub to it's standard layout.

Which I admit to still doing a lot of the time.
DNSB is online now   Reply With Quote
Old 10-03-2020, 09:11 AM   #19
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Hardly a "return." Sigil has never really stopped ensuring that the opf is in state that Sigil can properly parse. Nearly every aspect of Sigil's automated processes are predicated upon the opf being in a state that's both valid (RE spec) and useable by Sigil's parsing routines.

The OPF is one of the few places where Sigil's wishes may still trump the user's. Just hopefully only in minor esoterica like this example. I've not run into too many ebook creators who have an interest in preserving technically correct, but functionally purposeless namespace prefixing schemes. *shrug*

I know you were probably posting in a primarily ironic manner. but I wanted to be sure people understand that Sigil's move towards a "hands off" approach does not extend to every single aspect of the OPF.

With regard to the uncommon prefixes in this test sample, I believe I've seen those ns0, ns1 prefixes introduced by lxml parsing where no attempt to properly manage the namespace prefixes is made. Probably some sort of in-house automated script that no one has ever revisited since epubcheck doesn't bark about it.
DiapDealer is offline   Reply With Quote
Old 10-03-2020, 04:25 PM   #20
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,251
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by DiapDealer View Post
I know you were probably posting in a primarily ironic manner. but I wanted to be sure people understand that Sigil's move towards a "hands off" approach does not extend to every single aspect of the OPF.
The post was not meant to be taken seriously. If only MobileRead a set of tags for sarcasm, irony, etc.

Quote:
Originally Posted by DiapDealer View Post
With regard to the uncommon prefixes in this test sample, I believe I've seen those ns0, ns1 prefixes introduced by lxml parsing where no attempt to properly manage the namespace prefixes is made. Probably some sort of in-house automated script that no one has ever revisited since epubcheck doesn't bark about it.
I've had to clean up a couple of opfs that used namespaces that were not properly managed so I have no objection to Sigil doing the clean up for me as long as I am informed that it was done.
DNSB is online now   Reply With Quote
Old 10-03-2020, 05:36 PM   #21
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,731
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DNSB View Post
The post was not meant to be taken seriously. If only MobileRead a set of tags for sarcasm, irony, etc.
🙃 works for me.

BR
BetterRed is offline   Reply With Quote
Old 10-04-2020, 01:16 AM   #22
Thasaidon
Hedge Wizard
Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.Thasaidon ought to be getting tired of karma fortunes by now.
 
Thasaidon's Avatar
 
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
Quote:
Originally Posted by KevinH View Post
FWIW, pure xml allows any tags and attributes anyone would want. The problem is that two or more xml projects/language variants could use the same name for different tags that mean different things. And worse yet these names could needed to be used in the same xml file. So xml adopted the use of namespaces and these namespaces had to be unique so they decided to use a url/uri to represent them since no two different websites could have the same url. (These urls need not point to functional web pages but sometimes do).

The idea was to prefix each tag with its associated project namespace (url).. However that is too cumbersome in practice and shorter namespace prefixes were used instead. Things like opf: and dc: and even ns0: are examples of these shorter namespace prefixes.

Each prefix needs to be defined by using an xmlns attribute hopefully in the root tag and where else needed by using the xmlns attribute.

So the attribute: xmlnspf="http://www.idpf.org/2007/opf" is often seen in opf files to define the namespace associated with the opf: prefix.

To make notation even shorter a tag can define a default namespace that tells you that all tags without prefixes are using this namespace. For example:
xmlns="http://www.idpf.org/2007/opf" means that the tags in the opf namespace do not need a prefix at all.

Your epub opf defined an uncommon prefix (ns0 for tags in the opf namespace and then needed to prefix all tags with ns0: as a result.

This made the opf much more cumbersome than usual.

Sigil's code knows the urls associated with epub namespaces and now properly simplifies (cleans) them down to the most compact (typical) form so that they can be more easily be read, written, and parsed.

Hope something here helps.
Thank you.

That is one more step on my journey to learn about the OPF file and ePubs.

I bet just when I think I have learned all that is necessary it all changes.
Thasaidon is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem! massive problem! Persian Calibre 8 07-13-2011 04:39 PM
PRS-500 battery problem, but the battery's not the problem ZachC Sony Reader 7 01-11-2010 11:46 PM
Calibré problem (may be XP problem) Hildebrandt Calibre 3 07-23-2009 02:04 PM


All times are GMT -4. The time now is 03:43 PM.


MobileRead.com is a privately owned, operated and funded community.