![]() |
@DiapDealer ISBN vs UUID
Hello DiapDealer...
Found an old thread where you answered the question I have, which is how to use the ISBN in the metadata, vs the UUID... but I am new to opf and metadata code and am too dense ... I kindly need an example of what you mean. You said in this previous post in 2013): "It's quite trivial to change your ePub to use the ISBN identifier as the unique identifier (in Sigil) and get rid of the autogenerated UUID at any time, however: "Add the ISBN metadata (either through the metadata editor or add it manually in the OPF). Open the OPF file and add an id attribute to the isbn dc:indentifier entry you just created (I often use "isbn" but just so long as it's not the same as the "unique-identifier" attribute of the "package" element). Then change the "unique-identifier" attribute of the "package" element to match the id you just created for your ISBN entry. Save the epub and delete the entire <dc:identifier></dc:identifier> entry for the old UUID from the OPF." You lost me at "add an id attribute to the isbn identifier..." This is the relevant code (I think): <package version="2.0" unique-identifier="BookId" xmlns="http://www.idpf.org/2007/opf"> <metadata xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:identifier opf:scheme="ISBN">ISBN [isbn # here]</dc:identifier> I don't know the protocol for adding an attribute to a dc element.. ? If it needs dashes or underscores or colons or a single space or what? Sorry! Could you give an example...? I'd really appreciate it. |
On the first line you are simply telling what the name of the variable is that you are using for the unique-identifier. In this example it is "uid".
<package version="2.0" unique-identifier="uid" xmlns="http://www.idpf.org/2007/opf"> Then you are defining what that variable is: <dc:identifier id="uid">4183454533</dc:identifier> You can easily use the ISBN like this: <package version="2.0" unique-identifier="BookID" xmlns="http://www.idpf.org/2007/opf"> <dc:identifier id="BookID">ISBN [isbn # here]</dc:identifier> |
Quote:
dc:publisher Top Level Pub Co. Here dc:imprint Imprint Publisher Here ... which it does look like that in the metadata window... but when I switch to opf file, I see it inserts it with a name tag and encloses it in meta brackets... instead of just listing dc:imprint under all the other dc:xxxx elements. So not sure I am getting that right either. I know this is no-brainer stuff that takes one second to those familiar! EDIT: Argh, even my posts are making fun of me, inserting smileys! |
I'll try to color-code my stuff, maybe that'll make it easier to understand too!
Let's say you rip open a book created in Sigil. In your content.opf, you'll see something like this: Spoiler:
These two always have to match: - unique-identifier (up top) - id (down below) You can see they both say BookId. Note: Sigil uses "BookId", but you could call this anything. Note #2: The blue part is just a randomly generated UUID. All books are probably going to have different gibberish here depending on which program built it. Method 1 As Diap initially explained, you can change "BookId" to whatever name you name want. He mentioned he likes to use "isbn". So change both red parts, and move the id to where it's needed: Spoiler:
Remove the entire Blue line because it's not needed any more: Spoiler:
Method 2 Or as Turtle91 said: Just move the id="BookId": Spoiler:
And you can delete the entire blue line: Spoiler:
Quote:
Or when you're in the Advanced Editor, right below "Submit Reply" button, you can see a little checkbox for Disable smilies in text. |
I have nothing to add. :D
|
Quote:
And on a post from 2013 too! Must be a record. :D |
I was just happy you guys saved me the trouble of having to go back and do my homework. :o
|
Quote:
But I'm not sure about the toc.ncx, does this line have to be updated as well? toc.ncx: Code:
<meta name="dtb:uid" content="urn:uuid:acfa4835-af6c-4301-87f9-8c3ce0b9df94" />Not too sure what you should update if you manually remove the UUID. |
@Tex2002ans Thanks SO MUCH for that super clear tutorial. Always appreciate the help I get here.... you guys are invaluable.
I will check back to see if I should edit the tox as well. Again, can't thank you enough. |
Quote:
Without an update you will get an error (EpubCheck): Code:
ERROR(NCX-001): NCX identifier ('urn:uuid:acfa4835-af6c-4301-87f9-8c3ce0b9df9') does not match OPF identifier ('1-23456-789-0'). |
Quote:
Don't know where I would be without Sigil and this forum!!! MANY THANKS! |
PS In this line:
<dc:identifier opf:scheme="UUID" id="ISBN">urn:uuid:[isbn # here]</dc:identifier> ... I changed the blue to "urn:isbn" ... As stated, no errors in EpubCheck, but Kindle Converter hangs for first time and won't convert. When I hit cancel it says "check file, it might be corrupted." Should I leave it as "urn:uuid" ? EDIT: Never mind, the answer was in Tex's post! |
The ncx dbt:uid entry being flagged if it doesn't match the opf unique-id is actually relatively new to Epubcheck. I'm almost certain it wasn't problem back in 2013. ;)
In all honesty, I wouldn't even bother removing the uuid, or changing the unique-id from the uuid to the new isbn entry. It's really not worth the trouble, and there's absolutely no advantage to be gained. Just leave the uuid, the unique-id, and the ncx dbt:uid alone; then add a new ISBN meta item and be done with it. I can't remember the last commercial epub I looked at that used the isbn as the unique identifier. *shrug* |
Quote:
But regardless of what I do, the one whose code I changed (and re-checked many times now) will not convert, even though it gets zero errors in EpubCheck. I feel bad I made Tex take all that time to explain how to do all that to me, but FWIW (Tex), I did learn in the process... about code too, which I appreciate! But it looks like I will do as you suggest, as that seems to be the only way the Kindle Converter program is happy with it. So I'll leave well enough alone. BTW, I read the ISBN should be entered in the metadata field without hyphens. Is that the consensus? Again, a million thanks! |
Quote:
I recently purchased Wheel of Time Books #1-#6. #1 had an ISBN as the ID. The others used UUIDs. And The Expanse Book #5 had mismatching: content.opf: Quote:
Quote:
And another Tor book had: content.opf: Quote:
Quote:
(Because I've had books where I've cleaned up/converted, forgot to change UUID, and the highlights carry over in all the wrong locations. After copying/pasting in new info, the old highlights disappeared.) Quote:
I just insert it exactly as it looks as ISBN-10 or ISBN-13. |
| All times are GMT -4. The time now is 09:17 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.