![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
(There was also different & bug in an earlier version.) The workaround is to enter & 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. |
|
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,616
Karma: 29710338
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
![]() BR |
![]() |
![]() |
![]() |
#7 | ||
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,616
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
BR |
||
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,353
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
The bug only occurs when & entities occur in an attribute string value (typically the opf:file-as attribute) and the Metadata Editor is used. That is when & 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 & Author Two</dc:creator> Last edited by DiapDealer; 04-03-2016 at 11:27 AM. |
|
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
Code:
<dc:creator opf:role="aut" opf:file-as="Patterson, James & Karp, Marshall">James Patterson</dc:creator> <dc:creator opf:role="aut">Marshall Karp</dc:creator> |
|
![]() |
![]() |
![]() |
#11 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,616
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
![]() BR |
|
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,461
Karma: 5703586
Join Date: Nov 2009
Device: many
|
What do you mean "&" doesn't work?
If this is a dc:title metadata entry entered directly into the opf then "&" 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 "&" 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. |
![]() |
![]() |
![]() |
#13 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
#14 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
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. |
|
![]() |
![]() |
![]() |
#15 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
That shouldn't happen, because & 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? |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |