From f89df3db321e02a6678ac3af4daf25f1f1740a82 Mon Sep 17 00:00:00 2001 From: Bob Stayton Date: Fri, 20 Apr 2012 22:00:20 +0000 Subject: [PATCH] Various improvements in metadata handling, update the README to describe how metadata is handled. --- xsl/epub3/README | 192 +++++++++++++++++++++++++++++++ xsl/epub3/epub3-element-mods.xsl | 75 ++++++++++-- 2 files changed, 259 insertions(+), 8 deletions(-) diff --git a/xsl/epub3/README b/xsl/epub3/README index 8b3f30417..477e785fa 100644 --- a/xsl/epub3/README +++ b/xsl/epub3/README @@ -135,3 +135,195 @@ Ibis EPUB3 preview version - Does not format MathML yet. - Does not handle videodata or audiodata yet. - Handles SVG with external viewer. + + +EPUB metadata +======================== +The info child of the document's root element is used +by the stylesheet to create EPUB metadata. Note that +metadata is plain text, so element content is converted +to text using the XSL normalize-space() function. + +Here is the current mapping of info elements to EPUB +metadata. Any others are ignored for metadata, but +may appear on the EPUB HTML titlepage, depending on the +titlepage customization. + +NOTE: the elements (not attributes of meta) duplicate +the meta elements for backwards compatibility, per the +EPUB3 specification. They can be turned off with the +$epub.include.optional.metadata.dc.elements parameter. + +abstract +--------- +The content must be converted to a text string for the +OPF metadata. The stylesheet converts only title, para, +formalpara, and simpara children in an abstract. All other +child elements are ignored. It puts any title first. +The OPF output appears as: + +title: abstract text +title: abstract text + + +author +------- +If uses a personname child, then it applies the +DocBook XSL person.name template to arrange the name. +Otherwise processes org or orgname into the content. +Then it outputs: + +Firstname Surname +Firstname Surname + +If there are multiple authors, the number in the id attribute +is incremented each time. + + +authorgroup +------------- +Applies templates to all of its children. + + +bibliocoverage +--------------- +bibliocoverage text +bibliocoverage text + + +biblioid +-------------- +This usually has @class="isbn" for the ISBN number. It is used +as the EPUB3 unique-identifier. That isbn value +is also output as follows: + +urn:isbn:value +urn:isbn:value + +A biblioid element with other class names are converted in a similar manner. + + +bibliorelation +---------------- +bibliorelation text +bibliorelation text + + +bibliosource +---------------- +bibliosource text +bibliosource text + + +collab +------------ +If a personname child is used, then it calls the +person.name template, otherwise is uses the orgname or +collabname text. + +collab text +collab text + + +copyright +------------- +Arranges the copyright elements into a text string with +copyright symbol, dates, and holder, and then +generates: + +Copyright text +Copyright text + +Also, if there is no info/date element, then the copyright +year is used to generate: + +year +year + + +corpauthor +------------ +corpauthor text +corpauthor text + + +corpcredit +------------ +corpcredit text +corpcredit text + + +date +------------- +date text +date text + +See also: copyright. + + +editor +-------------- +If a personname child is used, then it calls the +person.name template, otherwise is uses the orgname text. + +An editor can be considered as either a creator (when there +is no author) or a contributor. The stylesheet parameter +'editor.property' can be set to either 'creator' or +'contributor' (default) at runtime. So the output is either: + +editor text +editor text + +or + +editor text +editor text + + +isbn, issn, etc. +----------------- +Handled like biblioid @class="isbn". + + +keyword +----------- +keyword text +keyword text + + +keywordset +------------ +Applies templates to its children. + + +othercredit +------------ +Handled like collab. + + +pubdate +------------ +Handled like date. + + +publisher +-------------- +Applies templates only to publishername. + + +publishername +--------------- +publishername text +publishername text + + +subjectset +-------------- +Applies templates to subject/subjecterm descendants. + + +subjectterm +------------------ +subjecterm text +subjecterm text + diff --git a/xsl/epub3/epub3-element-mods.xsl b/xsl/epub3/epub3-element-mods.xsl index 68894325e..228b9bc3c 100644 --- a/xsl/epub3/epub3-element-mods.xsl +++ b/xsl/epub3/epub3-element-mods.xsl @@ -450,9 +450,22 @@ article toc,title,figure,table,example,equation - - - + + + + + + + + + + + + + + + + @@ -476,6 +489,19 @@ article toc,title,figure,table,example,equation + + + + + + + + + + + + + @@ -492,24 +518,24 @@ article toc,title,figure,table,example,equation dcterms: - + - + - + - + @@ -517,7 +543,7 @@ article toc,title,figure,table,example,equation - + dcterms:contributor @@ -528,6 +554,39 @@ article toc,title,figure,table,example,equation + + + + + + + + + + + + + + + + + + + + + + + + + dcterms:contributor + + + + + + + + -- 2.40.0