Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-10-2023, 11:46 PM   #1
XVR
Junior Member
XVR began at the beginning.
 
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>
When I save the file after including the <x-metadata> information in the *.opf file, Sigil removes it automatically.

Is there a way to keep non-standard metadata tags in the *.opf file?

Thanks in advance for your help 🙏
XVR
XVR is offline   Reply With Quote
Old 05-11-2023, 12:44 AM   #2
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,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by XVR View Post
Is there a way to keep non-standard metadata tags in the *.opf file?XVR
This is a known Sigil issue.

@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>
Here are the relevant Amazon KDP recommendations for creating dictionaries.
Doitsu is offline   Reply With Quote
Advert
Old 05-11-2023, 08:16 AM   #3
XVR
Junior Member
XVR began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2022
Device: NA
Quote:
Originally Posted by Doitsu View Post
This is a known Sigil issue.

@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:
Good to know. Thank you for your feedback @Doitsu.

Cheers,
XVR
XVR is offline   Reply With Quote
Old 05-11-2023, 08:56 AM   #4
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,647
Karma: 5433388
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.
KevinH is offline   Reply With Quote
Old 05-11-2023, 02:31 PM   #5
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,647
Karma: 5433388
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?
KevinH is offline   Reply With Quote
Advert
Old 05-11-2023, 02:52 PM   #6
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
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>
BeckyEbook is offline   Reply With Quote
Old 05-11-2023, 03:15 PM   #7
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,647
Karma: 5433388
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:
From the epub 2.0 spec ...

The required metadata element is used to provide information about the publication as a whole. It may contain Dublin Core metadata elements directly or within a (now deprecated) dc-metadata sub-element. Supplemental metadata can also be specified directly or within a (now deprecated) x-metadata sub-element.

Reading Systems must allow the specification of the deprecated dc-metadata and x-metadata elements.

Newly created OPS 2.0 packages should not create dc-metadata or x-metadata elements.

If the dc-metadata element is used, all dc elements must go in dc-metadata and all other metadata elements, if any, must go into x-metadata. If the dc-metadata element is not used, all metadata elements must go directly in the metadata element.

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.
KevinH is offline   Reply With Quote
Old 05-11-2023, 03:28 PM   #8
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,647
Karma: 5433388
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.
KevinH is offline   Reply With Quote
Old 05-11-2023, 03:31 PM   #9
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,647
Karma: 5433388
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.
KevinH is offline   Reply With Quote
Reply

Tags
dictionary, kindle, metadata, opf file, sigil


Forum Jump

Similar Threads
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


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


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