![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2022
Device: NA
|
Non-standard metadata tags in OPF file are deleted when saving.
Hi community,
I'm currently woking in Sigil on a bilingual dictionary for Kindle. To define the Input and Output language I have to include a specialized <x-metadata> tag within the <metadata> tag in the content.opf file: Code:
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf"> ... <x-metadata> <DictionaryInLanguage>pi</DictionaryInLanguage> <DictionaryOutLanguage>en</DictionaryOutLanguage> <DefaultLookupIndex>Pali</DefaultLookupIndex> </x-metadata> ... </metadata> Is there a way to keep non-standard metadata tags in the *.opf file? Thanks in advance for your help 🙏 XVR |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,635
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
@KevinH if you're looking for a test case, here's a minimal Kindle epub dictionary. When opened with Sigil, the following metadata section is silently stripped: Code:
<x-metadata> <output encoding="utf-8"/> <DefaultLookupIndex>russian</DefaultLookupIndex> <DictionaryInLanguage>ru</DictionaryInLanguage> <DictionaryOutLanguage>en</DictionaryOutLanguage> </x-metadata> |
|
![]() |
![]() |
![]() |
#3 | |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: Mar 2022
Device: NA
|
Quote:
Cheers, XVR |
|
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
I'll look into it. Kindle should have just namespaced their tags and not tried to create their own base level tag that is not part of the opf spec.
|
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
One question: must this x-metadata tag be a child of the metadata tag? The docs show it as a standalone section after the metadata tag closes but those kindle docs are not very clear on that.
Having an x-metadata tag be its own section immediately after the closing metadata tag makes the most sense and would be the easiest way to handle this since it is not valid metadata. Will you please verify that kindle will properly process a standalone x-metadata section that is not a child of the metadata tag but comes immediately after? |
![]() |
![]() |
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 742
Karma: 2296998
Join Date: Jan 2017
Location: Poland
Device: Various
|
Here sample:
Code:
<package unique-identifier="uid" xmlns:dc="Dublin Core"> <metadata> <dc-metadata> <dc:Identifier id="uid">Special PL-RU</dc:Identifier> <dc:Title><h2>Special PL-RU</h2></dc:Title> <dc:Language>PL</dc:Language> </dc-metadata> <x-metadata> <DictionaryInLanguage>pl</DictionaryInLanguage> <DictionaryOutLanguage>ru</DictionaryOutLanguage> </x-metadata> </metadata> |
![]() |
![]() |
![]() |
#7 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
That shows a non-existent dc-metadata tag and the x-metadata tag as a child of the metadata tag.
Where on earth is the dc-metadata needed? Certainly not in opf for epub2 or epub3. It is handled by namespaces. Edit: I just checked and dc-metadata and x-metadata were both deprecated even BEFORE The epub 2.0 spec. Quote:
My question is the docs show x-metadata tags after the metadata tag closes, not a child. Where exactly does the kindle software look for it. Can it not be nested? Where is the package version attribute? Last edited by KevinH; 05-11-2023 at 03:30 PM. |
|
![]() |
![]() |
![]() |
#8 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Based on that alone, I do not think Sigil should be promoting or supporting the use of long long deprecated elements in the OPF just to support old kindle dictionaries.
Last edited by KevinH; 05-11-2023 at 03:30 PM. |
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
Perhaps file a bug report with kindle's dictionary software to not use long out of date opf constructs.
|
![]() |
![]() |
![]() |
Tags |
dictionary, kindle, metadata, opf file, sigil |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
OPF file to Metadata? | botmtl | Development | 4 | 10-09-2017 02:04 PM |
Reading Metadata from OPF file in Zip Archive | DMTaylor | Library Management | 6 | 01-02-2017 09:31 AM |
No metadata.opf file. Why? | chaot | Library Management | 6 | 06-30-2015 05:48 AM |
Deleted the metadata.db file | bmwr1200c | Calibre | 6 | 08-18-2011 10:45 AM |
Saving metadata to file? | al35 | Calibre | 20 | 07-23-2010 11:02 AM |