Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 04-25-2010, 07:40 AM   #1
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Multiple reference elements with the same type in the <guide>

I've been brushing up on the <guide> element part of the OPF spec since I'm adding this functionality to Sigil, and from my understanding of it, it can have several <reference> elements with the same type.

That makes no sense to me.

How can a book have several Lists of Illustration, or several indices or several title pages? Sure, I could imagine an omnibus of sorts needing this, but it still seems... weird.

What I find particularly puzzling is that guide part of the spec IMHO seems to be written with the assumption that there can be no such duplicates. The description of the "text" type states:

Quote:
First "real" page of content (e.g. "Chapter 1")
So there can hardly be more than one of these, since the Reading Systems wouldn't be able to tell which of the multiples to show to the user as "the first real page of content". Also, other parts of the spec that allow duplication of semantics (like, say, multiple author metadata) have this possibility explicitly stated. There is no such statement for the guide <reference> elements.

Clearly, since the spec doesn't forbid it, it is allowed. What I'm interested in is whether this is a good idea. Honestly, I don't think it is.

And the least you could say about that part of the spec is that it should have a statement eliminating the ambiguity.

I'm interested in what others think about this.

Last edited by Valloric; 04-25-2010 at 07:46 AM.
Valloric is offline   Reply With Quote
Old 04-25-2010, 09:55 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
In general, I agree, one would only want a single element of each type. But in other cases it would be too restrictive to have such a... er... restriction. A book can have several forewords, and definitely multiple (e.g.) other.map instances, each of them would be identified with a different "title" attribute. At the end of it, it's up to the reading system to properly handle these cases, and I'm sure all of them will assume there's only a toc and a cover (I don't even know a RS that deals with multiple titles or languages ), so even if it's allowed by the spec, and it could make sense in some cases, I don't think one should expect it to work any time soon...
Jellby is offline   Reply With Quote
Old 04-25-2010, 10:26 AM   #3
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by Jellby View Post
A book can have several forewords
Even knowing that the spec allows using multiple guide references with the same type, I'd still put all those forewords into one XHTML and then list that with one reference element.
Valloric is offline   Reply With Quote
Old 04-25-2010, 10:29 AM   #4
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: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As long as the combination of (type,title) is unique, I think its OK.
kovidgoyal is offline   Reply With Quote
Old 04-25-2010, 10:38 AM   #5
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by kovidgoyal View Post
As long as the combination of (type,title) is unique, I think its OK.
Interesting point. But the "title" attribute is optional. What happens when there are several references with the same type, and no title?

The spec should resolve this ambiguity.
Valloric is offline   Reply With Quote
Old 04-25-2010, 10:45 AM   #6
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: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Valloric View Post
Interesting point. But the "title" attribute is optional. What happens when there are several references with the same type, and no title?

The spec should resolve this ambiguity.
Certainly, the spec should specify that (title, type) must be unique. From the perspective of Sigil, I would assume that the spec does specify that.
kovidgoyal is offline   Reply With Quote
Old 04-25-2010, 10:57 AM   #7
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by kovidgoyal View Post
Certainly, the spec should specify that (title, type) must be unique. From the perspective of Sigil, I would assume that the spec does specify that.
I'm not following you. The spec doesn't even mention the "title" attribute in the guide section (except in their small example, which is non-normative, so it in effect doesn't exist), and the only conclusive proof that it is indeed optional comes from the RELAX NG schema in Appendix A:

Code:
<define name="OPF20.reference-element">
  <element name="reference">
    <ref name="OPF20.optional-id-attribute"/>
    <attribute name="type">
      <text/>
    </attribute>
    <optional>
    <attribute name="title">
      <text/>
    </attribute>
    </optional>
    <attribute name="href">
      <text/>
    </attribute>
    <ref name="OPF20.reference-content"/>
  </element>
</define>
So I don't see how it can be assumed from the perspective of Sigil that the spec specifies that (title, type) is a unique tuple.
Valloric is offline   Reply With Quote
Old 04-25-2010, 11:10 AM   #8
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: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I meant that if you impose that restriction, you will be compliant with the spec and not generate EPUB's with meaningless guide entries.
kovidgoyal is offline   Reply With Quote
Old 04-25-2010, 11:18 AM   #9
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by kovidgoyal View Post
I meant that if you impose that restriction, you will be compliant with the spec and not generate EPUB's with meaningless guide entries.
Ah, that makes sense.

But I'm going to go with the Sigil UI only supporting one instance of one guide type per book. From what I gather, this is what 99% of the users want, and it also simplifies the UI (there's no need to input a separate title attribute).

Direct OPF editing will come in the future, so those 1% will be able to do that then.
Valloric is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a <reference> item to <guide> in OPF file GRiker Sigil 2 04-12-2010 01:06 PM
Help me out: First use of these 4 sci-fi literary elements Steven Lake Writers' Corner 7 12-31-2009 10:02 AM
Reference Guide: How to Prepare Images for EPUB (and other) Formats Zorba ePub 13 11-22-2009 08:28 AM
Display File Type and Sort by Type pragmortal Calibre 7 09-21-2009 08:07 PM
Free PDF: Ubuntu Pocket Guide and Reference TadW Deals and Resources (No Self-Promotion or Affiliate Links) 4 01-30-2009 11:22 PM


All times are GMT -4. The time now is 12:10 AM.


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