Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 04-01-2016, 05:54 AM   #1
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
Ampersands and content.opf file

I'm designing an ebook with Daphnis & Chloe in the title, and the publisher may want me to use that style rather than Daphnis and Chloe. But putting & in

<dc:title>The Love Song of Daphnis & Chloe</dc:title>

prevents the ePub from validating; in fact the whole thing crashes. But

<dc:title>The Love Song of Daphnis and Chloe</dc:title> works as expected.

Is there a work around?

I personally don't like the Daphnis & Chloe formation anyway, but it's used several times in the text so I'm stuck with it.
AlexBell is offline   Reply With Quote
Old 04-01-2016, 06:05 AM   #2
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by AlexBell View Post
<dc:title>The Love Song of Daphnis & Chloe</dc:title>

prevents the ePub from validating; in fact the whole thing crashes.
Try <dc:title>The Love Song of Daphnis &amp; Chloe</dc:title>

The ampersand is a special reserved character when using markup language.
jackie_w is offline   Reply With Quote
Advert
Old 04-02-2016, 04:50 AM   #3
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
Quote:
Originally Posted by jackie_w View Post
Try <dc:title>The Love Song of Daphnis &amp; Chloe</dc:title>

The ampersand is a special reserved character when using markup language.
Thanks. I should have mentioned that I tried that also, and it doesn't work.
AlexBell is offline   Reply With Quote
Old 04-02-2016, 04:57 AM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,596
Karma: 23164939
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by AlexBell View Post
Thanks. I should have mentioned that I tried that also, and it doesn't work.
If you used Sigil 0.9.4, there's a bug in the Metadata Editor. It'll delete &amp; entities if you open and close the Metadata Editor.
(There was also different &amp; bug in an earlier version.)
The workaround is to enter &amp; directly into the .opf file.
BTW, even though Calibre and other tools use an ampersand for two authors, I remember having read somewhere that the proper way would be to have two author metadata entries.

Last edited by Doitsu; 04-02-2016 at 05:00 AM.
Doitsu is offline   Reply With Quote
Old 04-02-2016, 05:17 AM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by Doitsu View Post
If you used Sigil 0.9.4, there's a bug in the Metadata Editor. It'll delete &amp; entities if you open and close the Metadata Editor.
(There was also different &amp; bug in an earlier version.)
The workaround is to enter &amp; directly into the .opf file.
BTW, even though Calibre and other tools use an ampersand for two authors, I remember having read somewhere that the proper way would be to have two author metadata entries.
Correct, it should be different author metadata entries. However, not all readers will actually honor that and will arbitrary use only one of the authors then.
Toxaris is offline   Reply With Quote
Advert
Old 04-02-2016, 05:20 AM   #6
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: 20,644
Karma: 26960534
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Most style guides mandate that the '&' only be used in things like brand names (Dolce & Gabbano, Johnson & Johnson, Buckley's & Nunn ) Google NGram finds no fiction with "Daphnis & Chloe" - but it appears frequently in non fiction - magazines, blogs etc.

BR
BetterRed is offline   Reply With Quote
Old 04-02-2016, 07:00 PM   #7
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: 20,644
Karma: 26960534
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by jackie_w View Post
Try <dc:title>The Love Song of Daphnis &amp; Chloe</dc:title>

The ampersand is a special reserved character when using markup language.
Quote:
Originally Posted by AlexBell View Post
Thanks. I should have mentioned that I tried that also, and it doesn't work.
There is a fix in the Sigil development pipeline, and Kevin has suggested a workaround here ==>> https://www.mobileread.com/forums/sho...2&postcount=58

BR
BetterRed is offline   Reply With Quote
Old 04-03-2016, 02:36 AM   #8
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
Thanks for all the suggestions:

- about Sigil: I may be the only ebook designer in the world who doesn't use Sigil. Being old and set in my ways I use the HTML editor I used when I dabbled in website design.

@BetterRed: I don't like Daphnis & Chloe either. But who am I to argue with the author and editor? The editor at least has accepted that on an ebook booklist the title will appear as Daphnis and Chloe. But she still wants Daphnis & Chloe everywhere else.

Last edited by AlexBell; 04-05-2016 at 04:35 AM. Reason: fixed type
AlexBell is offline   Reply With Quote
Old 04-03-2016, 11:20 AM   #9
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: 27,586
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
If you used Sigil 0.9.4, there's a bug in the Metadata Editor. It'll delete &amp; entities if you open and close the Metadata Editor.
(There was also different &amp; bug in an earlier version.)
The workaround is to enter &amp; directly into the .opf file.
BTW, even though Calibre and other tools use an ampersand for two authors, I remember having read somewhere that the proper way would be to have two author metadata entries.
The current Sigil bug (v0.9.5) doesn't rear it's ugly head quite that easily. You can, in fact, enter an ampersand character in the metadata editor in most fields, and it will be properly saved to the OPF as an &amp; entity. And vice-versa: manually entering an &amp; entity in the OPF will still allow you to later edit the metadata with Sigil's Metadata Editor without fear of &amp; entities being deleted.

The bug only occurs when &amp; entities occur in an attribute string value (typically the opf:file-as attribute) and the Metadata Editor is used. That is when &amp; entities will disappear from your OPF file. Entering an ampersand character in a "opf:file-as" string value in the Metadata Editor will also trigger it. And it's been fixed for the next release as BetterRed mentioned.

In the meantime, KevinH's workaround (as, again, BetterRed mentioned) will work. If you need two authors in one dc:creator tag, just use a different separator for the opf:file-as attribute string, such as a semi-colon (either manually or WITH the Metadata Editor) and you'll be fine:
Code:
<dc:creator opf:role="aut" opf:file-as="One, Author; Two, Author">Author One &amp; Author Two</dc:creator>

Last edited by DiapDealer; 04-03-2016 at 11:27 AM.
DiapDealer is offline   Reply With Quote
Old 04-03-2016, 11:37 AM   #10
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by Doitsu View Post
BTW, even though Calibre and other tools use an ampersand for two authors, I remember having read somewhere that the proper way would be to have two author metadata entries.
Just FYI, even though the calibre library window displays as Author A & Author B, when the metadata is written into the epub (via Polish or something similar) it is in fact written as 2 <dc:creator> entries in the .opf file. E.g.
Code:
<dc:creator opf:role="aut" opf:file-as="Patterson, James &amp; Karp, Marshall">James Patterson</dc:creator>
<dc:creator opf:role="aut">Marshall Karp</dc:creator>
jackie_w is offline   Reply With Quote
Old 04-03-2016, 06:38 PM   #11
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: 20,644
Karma: 26960534
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by AlexBell View Post
@BetterRed: I don't like Daphnis & Chloe either. But who am I to argue with the author and editor? The editor at least has accepted that on an ebook booklist the title will appear as Daphnis and Chloe. But she still wants Daphnis & Chloe everywhere else.
I'm guessing the book references/channels Ravel's ballet or Offenbachs opera of the same name - Daphnis et Chloé. So they could argue -- given the ampersand is derived from 'Et' its usage is faithful to the French rendition of the original Δάφνις καὶ Χλόη, (Daphnis kai Chloē). Bit of long bow but -- and would they have the wit. Probably best to let it go through to the keeper

BR
BetterRed is offline   Reply With Quote
Old 04-04-2016, 10:38 AM   #12
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: 7,710
Karma: 5444398
Join Date: Nov 2009
Device: many
What do you mean "&amp;" doesn't work?

If this is a dc:title metadata entry entered directly into the opf then "&amp;" is the only correct way I know to handle that. It is an official xml escape sequence that is recognized and understood by html, html5, xml, xhtml, etc.

Alternatively, you can try replacing the "&" with a numeric entity "& # 38 ;" (without the spaces) but if "&amp;" doesn't work I have my doubts that "& # 38 ;" (again without the spaces) will work either.

And specifically what do you mean, it doesn't work? What are you viewing the opf or metadata with that is showing it doesn't work?

KevinH

Last edited by KevinH; 04-04-2016 at 10:41 AM.
KevinH is online now   Reply With Quote
Old 04-05-2016, 04:37 AM   #13
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
Quote:
Originally Posted by KevinH View Post
What do you mean "&amp;" doesn't work?

If this is a dc:title metadata entry entered directly into the opf then "&amp;" is the only correct way I know to handle that. It is an official xml escape sequence that is recognized and understood by html, html5, xml, xhtml, etc.

Alternatively, you can try replacing the "&" with a numeric entity "& # 38 ;" (without the spaces) but if "&amp;" doesn't work I have my doubts that "& # 38 ;" (again without the spaces) will work either.

And specifically what do you mean, it doesn't work? What are you viewing the opf or metadata with that is showing it doesn't work?

KevinH
I mean it doesn't validate with Epub-Checker
AlexBell is offline   Reply With Quote
Old 04-05-2016, 04:48 AM   #14
AlexBell
Wizard
AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.AlexBell ought to be getting tired of karma fortunes by now.
 
AlexBell's Avatar
 
Posts: 3,413
Karma: 13369310
Join Date: May 2008
Location: Launceston, Tasmania
Device: Sony PRS T3, Kobo Glo, Kindle Touch, iPad, Samsung SB 2 tablet
Quote:
Originally Posted by BetterRed View Post
I'm guessing the book references/channels Ravel's ballet or Offenbachs opera of the same name - Daphnis et Chloé. So they could argue -- given the ampersand is derived from 'Et' its usage is faithful to the French rendition of the original Δάφνις καὶ Χλόη, (Daphnis kai Chloē). Bit of long bow but -- and would they have the wit. Probably best to let it go through to the keeper

BR
No, it's actually a verse rendition of the Thornley translation.

But you've raised another hare now. Should the e in Chloe have a diacritic? I've seen Ravel's ballet 'Daphnis et Chloé, and very occasionally I've seen it in English as Chloë. But since by far the most common spelling is Chloe that's how I left it.
AlexBell is offline   Reply With Quote
Old 04-05-2016, 04:57 AM   #15
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,596
Karma: 23164939
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by AlexBell View Post
I mean it doesn't validate with Epub-Checker
That shouldn't happen, because &amp; is part of the XML 1.0 specs.

Can you please post the .opf file that caused this error message?

Also, which ePubCheck app/version did you use?
Doitsu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change opf filename from content.opf to title.opf northstar7 Sigil 3 09-23-2013 12:44 PM
Sigil 0.5.3 keeps rebuilding my content.opf file from scratch mtrahan Sigil 7 04-28-2012 09:10 AM
TWO OPF files or something like Media Queries in the OPF file for KF8 and MOBI? DHahn Kindle Formats 3 04-17-2012 04:06 AM
OPF file OPS/package.opf is missing Run2Eat ePub 2 05-31-2011 06:52 PM
cleaning the content.opf file Adjust ePub 6 09-01-2010 05:54 PM


All times are GMT -4. The time now is 05:15 PM.


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