Insert metadata in the <head> for HTML5 files
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Insert metadata in the <head> for HTML5 files
Hello,
I'm currently in a situation where I notice that metadata declared inn a bookmeta is not propagated into an HTML5 publication, in the <head> element. When publishing my ditamap, I can see it is processed and available in the temp folder.
For instance :
is rendered as:
and the index.html renders this:
Thus, how could I get the previous declaration visible in the <head> element?
I'm currently in a situation where I notice that metadata declared inn a bookmeta is not propagated into an HTML5 publication, in the <head> element. When publishing my ditamap, I can see it is processed and available in the temp folder.
For instance :
Code: Select all
<copyrfirst>
<year>2021</year>
</copyrfirst>
Code: Select all
<copyrfirst class="- topic/data bookmap/copyrfirst " xtrc="copyrfirst:1;10:16"
xtrf="file:/Users/xxxxxx/0P18U-TEMP-SEN.ditamap">
Code: Select all
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta name="copyright" content="(C) Copyright 2022">
<meta name="DC.rights.owner" content="(C) Copyright 2022">
<meta name="DC.type" content="bookmap">
<meta name="DC.format" content="HTML5">
<meta name="DC.identifier" content="guid-e510e093-49cd-4ea5-8c1d-fdc0b0d5c1ea">
<meta name="DC.language" content="en-us">
<link rel="stylesheet" type="text/css" href="commonltr.css">
<title>0P18U-Map</title>
</head>
------
Gaspard
Gaspard
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Insert metadata in the <head> for HTML5 files
Post by chrispitude »
Hi gbv34,
Can you give me a sample metadata block from one of your books to experiment with?
Can you give me a sample metadata block from one of your books to experiment with?
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Re: Insert metadata in the <head> for HTML5 files
Hi Chris!
Sure. here it is:
Sure. here it is:
Code: Select all
<bookmeta>
<bookrights>
<copyrfirst>
<year>2021</year>
</copyrfirst>
<copyrlast>
<year/>
</copyrlast>
<bookowner>
<organization/>
</bookowner>
</bookrights>
<pif_content_type value="Product_Status"/>
<pif_release_type value="dummy-value"/>
<pif_release_to_sales_date value="10/20/2011 12:00:00 AM"/>
<pif_part_sample_date value=""/>
<pif_vintage_year value=""/>
</bookmeta>
------
Gaspard
Gaspard
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Insert metadata in the <head> for HTML5 files
Post by chrispitude »
Hmm, this might be more work than I thought! From experimentation, I see that <topicmeta> in a <map> cascades down into topics when published, but <bookmeta> in a <bookmap> does not.
The code that propagates metadata from map to topic is in the MoveMetaModule Java module:
https://github.com/dita-ot/dita-ot/blob ... odule.java
but I don't know Java well enough to conclude anything about <bookmeta> versus <topicmeta> from the code.
Another interesting finding is that even with <topicmeta>, the html5 transformation seems to include less metadata in the topics than the xhtml transformation, but I haven't looked into the transformation XSLTs to see if there's some way to configure that.
Here are the metadata cascade rules I found for DITA 1.3:
http://docs.oasis-open.org/dita/dita/v1 ... adata.html
If you publish to XHTML instead of HTML5, do you get anything more useful in the topics from your map?
The code that propagates metadata from map to topic is in the MoveMetaModule Java module:
https://github.com/dita-ot/dita-ot/blob ... odule.java
but I don't know Java well enough to conclude anything about <bookmeta> versus <topicmeta> from the code.
Another interesting finding is that even with <topicmeta>, the html5 transformation seems to include less metadata in the topics than the xhtml transformation, but I haven't looked into the transformation XSLTs to see if there's some way to configure that.
Here are the metadata cascade rules I found for DITA 1.3:
http://docs.oasis-open.org/dita/dita/v1 ... adata.html
If you publish to XHTML instead of HTML5, do you get anything more useful in the topics from your map?
-
- Posts: 105
- Joined: Thu Jan 20, 2022 12:36 pm
Re: Insert metadata in the <head> for HTML5 files
Hi Chris!
Sorry for my late response and thanks a lot for your feedback.
I'm still surprised that out-of-the-box any XHTML output doesn't include in the index.html the metadata declarations made in a topicmeta or bookmeta.
I also noticed this behavior recently with change-histolrylist element and other related elements.
Typically, the following declaration:
only provides this information in the head
Sorry for my late response and thanks a lot for your feedback.
I'm still surprised that out-of-the-box any XHTML output doesn't include in the index.html the metadata declarations made in a topicmeta or bookmeta.
I also noticed this behavior recently with change-histolrylist element and other related elements.
Typically, the following declaration:
Code: Select all
<bookmeta>
<critdates>
<created date="2015-01-01"/>
<revised modified="2015-02-01"/>
<revised modified="2015-03-01"/>
<revised modified="2016-04-01"/>
</critdates>
<change-historylist>
<change-item>
<change-completed>2015-07-20</change-completed>
<change-summary>Document title updated from "Widget Repair" to "Widget X2 Repair".</change-summary>
<data>Product has been updated and the document has been expanded with fresh examples of widget repair.</data>
</change-item>
<change-item>
<change-completed>2013-11-01</change-completed>
<change-summary>Original document title changed from "Foobar Repair" to "Widget Repair"</change-summary>
<data>Original product name has been changed, with "Widget" the official product name. Content has also been
updated to include the latest content up to the time of its official release.</data>
</change-item>
</change-historylist>
</bookmeta>
image.png
You do not have the required permissions to view the files attached to this post.
------
Gaspard
Gaspard
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service