From 6a9e54102cc02eb320bd4308c3678677d9cac87d Mon Sep 17 00:00:00 2001 From: Jostein Austvik Jacobsen Date: Wed, 12 Sep 2018 16:55:47 +0200 Subject: [PATCH] added more vocabulary terms. better handling of namespaces/prefixes. fixes #74 fixes #358 fixes #359 from core epub vocabulary: - added `endnote`/`endnotes` in addition to the deprecated `rearnote`/`rearnotes` from dictionaries vocabulary: - `antonym-group` - `condensed-entry` - `def` - `dictentry` - `etymology` - `example` - `gram-info` - `idiom` - `part-of-speech` - `part-of-speech-group` - `part-of-speech-list` - `phonetic-transcription` - `phrase-group` - `phrase-list` - `sense-group` - `sense-list` - `synonym-group` - `tran` - `tran-info` from indexes vocabulary: - `index-editor-note` - `index-entry` - `index-entry-list` - `index-locator` - `index-locator-list` - `index-locator-range` - `index-term` - `index-term-categories` - `index-term-category` - `index-xref-preferred` from magazine vocabulary: - `prism:title` - `prism:deck` - `prism:subtitle` - `prism:byline` - `prism:contributors` - `prism:caption` - `prism:credit` - `prism:box` - `prism:advertisement` - `prism:pullQuote` - `msv:article-region` - `msv:article-text` - `msv:media` - namespaces: - `msv: http://www.idpf.org/epub/vocab/structure/magazine/#` - `prism: http://www.prismstandard.org/specifications/3.0/PRISM_CV_Spec_3.0.htm#` from EDUPUB: - `biblioref` - `credit` - `feedback` - `fill-in-the-blank-problem` - `general-problem` - `glossref` - `label` - `learning-objective` - `learning-objectives` - `learning-outcome` - `learning-outcomes` - `learning-resource` - `learning-resources` - `learning-standard` - `learning-standards` - `match-problem` - `multiple-choice-problem` - `ordinal` - `pullquote` - `question` - `referrer` - `true-false-problem` Removed `nordic272a` as it is redundant and actually had a bug in it preventing correct usage of annotations. Various other changes. --- .../resources/xml/schema/nordic-html5.rng | 89 ++++++++++++++- .../resources/xml/schema/nordic2015-1.sch | 104 +++++++++++++----- .../xml/xproc/step/dtbook-to-html.step.xpl | 8 ++ .../xml/xproc/step/epub3-to-html.step.xpl | 15 ++- .../xml/xslt/deep-level-grouping.xsl | 18 +-- .../resources/xml/xslt/dtbook-legacy-fix.xsl | 8 +- .../resources/xml/xslt/dtbook-to-epub3.xsl | 23 +++- .../xml/xslt/dtbook2005-to-dtbook110.xsl | 2 +- .../resources/xml/xslt/epub3-to-dtbook.xsl | 2 +- src/main/resources/xml/xslt/epub3-vocab.xsl | 2 +- .../epubcheck-report-to-pipeline-report.xsl | 2 +- .../xml/xslt/fix-section-hierarchy.xsl | 2 +- .../xml/xslt/generate-missing-headlines.xsl | 4 +- .../xml/xslt/html-to-opf-metadata.xsl | 12 +- .../xslt/improve-html-report-readability.xsl | 20 ++-- src/main/resources/xml/xslt/info-report.xsl | 6 +- .../xslt/make-uris-relative-to-document.xsl | 4 +- .../xml/xslt/navdoc-nordic-normalization.xsl | 20 +++- .../resources/xml/xslt/navdoc-to-outline.xsl | 16 +-- .../xml/xslt/opf-to-html-metadata.xsl | 13 ++- src/main/resources/xml/xslt/pretty-print.xsl | 6 +- .../xslt/replace-sections-with-documents.xsl | 24 +++- ...ingle-html-hrefs-with-multi-html-hrefs.xsl | 4 +- .../xml/xslt/split-html.annotate.xsl | 20 ++-- src/main/resources/xml/xslt/split-html.xsl | 33 ++++-- .../xml/xslt/update-epub-prefixes.xsl | 64 +++++++++++ src/test/resources/C00000.epub | Bin 309167 -> 309191 bytes .../C00000/EPUB/C00000-04-chapter.xhtml | 2 +- src/test/resources/DTBook/C00000.xml | 2 +- src/test/resources/single-html/C00000.xhtml | 2 +- src/test/xprocspec/dtbook-to-epub3.xprocspec | 2 - src/test/xspec/dtbook-to-epub3.xspec | 13 ++- src/test/xspec/navdoc-to-outline.xspec | 6 +- src/test/xspec/opf-to-html-metadata.xspec | 6 +- .../replace-sections-with-documents.xspec | 57 +++++----- src/test/xspec/split-html.xspec | 68 ++++++++---- src/test/xspec/update-epub-prefixes.xspec | 72 ++++++++++++ 37 files changed, 559 insertions(+), 192 deletions(-) create mode 100644 src/main/resources/xml/xslt/update-epub-prefixes.xsl create mode 100644 src/test/xspec/update-epub-prefixes.xspec diff --git a/src/main/resources/xml/schema/nordic-html5.rng b/src/main/resources/xml/schema/nordic-html5.rng index 32395152..6361a6e7 100644 --- a/src/main/resources/xml/schema/nordic-html5.rng +++ b/src/main/resources/xml/schema/nordic-html5.rng @@ -365,9 +365,12 @@ The HTML root element (<html>) represents the root of an HTML document. All other elements must be descendants of this element. - - z3998: http://www.daisy.org/z3998/2012/vocab/structure/# - + + + + + + @@ -3166,6 +3169,7 @@ rearnotes + endnotes footnotes @@ -3633,6 +3637,7 @@ index-legend index-group glossary + dictionary bibliography halftitlepage @@ -3655,6 +3660,7 @@ practices footnotes rearnotes + endnotes page-list z3998:section z3998:subsection @@ -3703,6 +3709,7 @@ fulltitle + glossdef glossterm halftitle @@ -3731,7 +3738,9 @@ rearnote + endnote + subtitle @@ -3946,6 +3955,80 @@ z3998:weight + + + antonym-group + condensed-entry + def + dictentry + etymology + example + gram-info + idiom + part-of-speech + part-of-speech-group + part-of-speech-list + phonetic-transcription + phrase-group + phrase-list + sense-group + sense-list + synonym-group + tran + tran-info + + + index-editor-note + index-entry + index-entry-list + index-locator + index-locator-list + index-locator-range + index-term + index-term-categories + index-term-category + index-xref-preferred + + + + + prism:title + prism:deck + prism:subtitle + prism:byline + prism:contributors + prism:caption + prism:credit + prism:box + prism:advertisement + prism:pullQuote + msv:article-region + msv:article-text + msv:media + + + biblioref + credit + feedback + fill-in-the-blank-problem + general-problem + glossref + label + learning-objective + learning-objectives + learning-outcome + learning-outcomes + learning-resource + learning-resources + learning-standard + learning-standards + match-problem + multiple-choice-problem + ordinal + pullquote + question + referrer + true-false-problem diff --git a/src/main/resources/xml/schema/nordic2015-1.sch b/src/main/resources/xml/schema/nordic2015-1.sch index 2d425472..25a9a606 100644 --- a/src/main/resources/xml/schema/nordic2015-1.sch +++ b/src/main/resources/xml/schema/nordic2015-1.sch @@ -6,7 +6,10 @@ - + + + + @@ -169,7 +172,7 @@ - + [nordic26a] Each note must have at least one <a epub:type="noteref" ...> referencing it: @@ -180,8 +183,8 @@ - [nordic26b] The note reference with the - href "" attribute must resolve to a note, rearnote or footnote in the publication: [nordic26b] The note reference with the + href "" attribute must resolve to a note, rearnote, endnote or footnote in the publication: @@ -254,7 +257,7 @@ self::html:p[parent::html:header[parent::html:body] and tokenize(@epub:type,' ')='z3998:author'] or self::html:h1[tokenize(@epub:type,' ')='fulltitle'] or self::html:aside[tokenize(@epub:type,' ')='epigraph'] or self::html:p[tokenize(@class,' ')='line'] or self::html:*[tokenize(@class,' ')='linegroup'] or - self::html:*[self::html:ul or self::html:ol] or self::html:a[tokenize(@epub:type,' ')=('note','rearnote','footnote')] or self::html:p or + self::html:*[self::html:ul or self::html:ol] or self::html:a[tokenize(@epub:type,' ')=('note','rearnote','endnote','footnote')] or self::html:p or self::html:*[tokenize(@epub:type,' ')='z3998:poem'] or self::html:*[(self::figure or self::aside) and tokenize(@epub:type,'s')='sidebar'] or self::html:table or self::html:*[matches(local-name(),'^h\d$') and tokenize(@class,' ')='title']]" >[nordic29] Prodnote in inline context used as block element: - - [nordic128a] xmlns:nordic="http://www.mtm.se/epub/" must be defined on the root html element. + + + + [nordic128a] on the html element: the epub:prefix attribute must declare the '' prefix + [nordic128e] in the epub:prefix attribute on the html element: the namespace for the '' prefix must be '' + + + + + prefixes: + [nordic128e] all of the prefixes in use () on the element () must be declared in the epub:prefix attribute on the html element: '<html epub:prefix="">...</html> + [nordic128e] in the epub:prefix attribute on the html element: the namespaces for the prefixes must be correct. @@ -490,7 +515,7 @@ [nordic128d] nordic:supplier metadata must occur once. - + @@ -576,9 +601,9 @@ + 'z3998:publisher-address','qna','rearnotes','endnotes','revision-history','z3998:section','seriespage','subchapter','z3998:subsection','toc','toc-brief','z3998:translator-note','volume')"/> [nordic202] '' is not an allowed type in frontmatter. On elements with the epub:type "frontmatter", you can @@ -587,13 +612,18 @@ - + [nordic203a] 'rearnote' must have a section ancestor with 'rearnotes': + + [nordic203a] 'endnote' must have a section ancestor with 'endnotes': + @@ -603,6 +633,12 @@ [nordic204c] with the epub:type 'rearnotes' must have <ol> descendant elements. + + [nordic203c] with the epub:type + 'endnotes' must have descendants with 'endnote'. + [nordic204c] with the epub:type 'endnotes' must have <ol> descendant + elements. + @@ -612,9 +648,15 @@ [nordic203d] The 'notebody' class must be applied to all rearnotes: + + [nordic203d] 'endnote' can only be applied to <li> elements: + [nordic203d] The 'notebody' class must be applied to all endnotes: + - + [nordic204a] 'footnote' must have a section + 'z3998:publisher-address','qna','rearnotes','endnotes','revision-history','z3998:section','seriespage','subchapter','z3998:subsection','toc','toc-brief','z3998:translator-note','volume')"/> [nordic208] '' is not an allowed type in bodymatter. Elements with the type "bodymatter" must also have one of the types or ' + 'z3998:publisher-address','qna','rearnotes','endnotes','revision-history','z3998:section','seriespage','subchapter','z3998:subsection','toc','toc-brief','z3998:translator-note','volume')"/> + 'z3998:publisher-address','qna','rearnotes','endnotes','revision-history','z3998:section','seriespage','subchapter','z3998:subsection','toc','toc-brief','z3998:translator-note','volume')"/> [nordic215] '' is not an allowed type in backmatter. On elements with the epub:type "backmatter", you can either @@ -891,6 +933,10 @@ [nordic267a] Rearnotes must be wrapped in a "ol" element, but is currently wrapped in a : + + [nordic267a] Endnotes must be wrapped in a "ol" element, but is currently wrapped in a : + @@ -898,6 +944,10 @@ [nordic267b] List items inside a rearnotes list must use epub:type="rearnote": + + [nordic267b] List items inside a endnotes list must use epub:type="endnote": + @@ -939,18 +989,6 @@ - - - - - [nordic272a] Note reference href attribute does not contain a fragment identifier: - [nordic272b] Annotation - reference href attribute does not resolve to a note, rearnote or footnote in the publication: - - - @@ -1112,5 +1150,11 @@ select="concat('<',name(),string-join(for $a in (@*) return concat(' ',$a/name(),'="',$a,'"'),''),'>')"/> + + + + [nordic283] When using MathML with a namespace prefix, that prefix must be 'm'. Not + + diff --git a/src/main/resources/xml/xproc/step/dtbook-to-html.step.xpl b/src/main/resources/xml/xproc/step/dtbook-to-html.step.xpl index d0e5337b..c18554b3 100644 --- a/src/main/resources/xml/xproc/step/dtbook-to-html.step.xpl +++ b/src/main/resources/xml/xproc/step/dtbook-to-html.step.xpl @@ -92,6 +92,14 @@ + + + + + + + + diff --git a/src/main/resources/xml/xproc/step/epub3-to-html.step.xpl b/src/main/resources/xml/xproc/step/epub3-to-html.step.xpl index f0f5916f..aafd1580 100644 --- a/src/main/resources/xml/xproc/step/epub3-to-html.step.xpl +++ b/src/main/resources/xml/xproc/step/epub3-to-html.step.xpl @@ -1,7 +1,7 @@ - + @@ -244,6 +244,9 @@ + + + @@ -252,7 +255,7 @@ - + @@ -264,6 +267,14 @@ + + + + + + + + diff --git a/src/main/resources/xml/xslt/deep-level-grouping.xsl b/src/main/resources/xml/xslt/deep-level-grouping.xsl index e7901a2c..1476ba8f 100644 --- a/src/main/resources/xml/xslt/deep-level-grouping.xsl +++ b/src/main/resources/xml/xslt/deep-level-grouping.xsl @@ -63,7 +63,7 @@ - + @@ -157,11 +157,11 @@ - + - + @@ -172,8 +172,8 @@ - - + + @@ -193,7 +193,7 @@ - + @@ -204,8 +204,8 @@ - - + + @@ -224,7 +224,7 @@ - + diff --git a/src/main/resources/xml/xslt/dtbook-legacy-fix.xsl b/src/main/resources/xml/xslt/dtbook-legacy-fix.xsl index c36d199f..cfda82d3 100644 --- a/src/main/resources/xml/xslt/dtbook-legacy-fix.xsl +++ b/src/main/resources/xml/xslt/dtbook-legacy-fix.xsl @@ -24,7 +24,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -109,7 +109,7 @@ - + diff --git a/src/main/resources/xml/xslt/dtbook-to-epub3.xsl b/src/main/resources/xml/xslt/dtbook-to-epub3.xsl index c1a7615c..93449a43 100644 --- a/src/main/resources/xml/xslt/dtbook-to-epub3.xsl +++ b/src/main/resources/xml/xslt/dtbook-to-epub3.xsl @@ -1,7 +1,15 @@ - + @@ -127,8 +135,8 @@ - - + + @@ -144,11 +152,12 @@ - + + @@ -284,6 +293,7 @@ <xsl:template match="dtbook:meta"> <xsl:choose> + <xsl:when test="starts-with(@name,'dtb:')"/> <xsl:when test="matches(@name,'dc:title','i') or matches(@name,'dc:identifier','i') or matches(@name,'dc:format','i') or starts-with(@name,'track:')"/> <xsl:otherwise> <meta> @@ -309,6 +319,7 @@ <xsl:template match="dtbook:book"> <body> + <xsl:copy-of select="namespace::*[not(.='http://www.daisy.org/z3986/2005/dtbook/')]" exclude-result-prefixes="#all"/> <xsl:call-template name="f:attlist.book"/> <xsl:apply-templates select="node()"/> </body> diff --git a/src/main/resources/xml/xslt/dtbook2005-to-dtbook110.xsl b/src/main/resources/xml/xslt/dtbook2005-to-dtbook110.xsl index 6bfb852d..3aef6c16 100644 --- a/src/main/resources/xml/xslt/dtbook2005-to-dtbook110.xsl +++ b/src/main/resources/xml/xslt/dtbook2005-to-dtbook110.xsl @@ -529,7 +529,7 @@ <xsl:value-of select="@id"/> <xsl:text>'></xsl:text> <xsl:variable name="nodeAsStr" select="string(.)"/> - <xsl:copy-of select="$nodeAsStr"/> + <xsl:copy-of select="$nodeAsStr" exclude-result-prefixes="#all"/> <xsl:text></pagenum></xsl:text> </xsl:comment> </xsl:when> diff --git a/src/main/resources/xml/xslt/epub3-to-dtbook.xsl b/src/main/resources/xml/xslt/epub3-to-dtbook.xsl index fea2a1e6..a36daf47 100644 --- a/src/main/resources/xml/xslt/epub3-to-dtbook.xsl +++ b/src/main/resources/xml/xslt/epub3-to-dtbook.xsl @@ -851,7 +851,7 @@ </xsl:template> <xsl:template name="f:attlist.noteref"> - <xsl:if test="@class or f:types(.)[not(.='noteref')]"> + <xsl:if test="f:classes(.)[not(.='noteref')] or f:types(.)[not(.='noteref')]"> <xsl:message select="'the class attribute on a noteref was dropped since it is not allowed in Nordic DTBook.'"/> </xsl:if> <xsl:call-template name="f:attrs"> diff --git a/src/main/resources/xml/xslt/epub3-vocab.xsl b/src/main/resources/xml/xslt/epub3-vocab.xsl index 0fb8968d..fccc22ec 100644 --- a/src/main/resources/xml/xslt/epub3-vocab.xsl +++ b/src/main/resources/xml/xslt/epub3-vocab.xsl @@ -2,7 +2,7 @@ <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:variable name="vocab-default" - select="('cover','frontmatter','bodymatter','backmatter','volume','part','chapter','subchapter','division','abstract','foreword','preface','prologue','introduction','preamble','conclusion','epilogue','afterword','epigraph','toc','toc-brief','landmarks','loa','loi','lot','lov','appendix','colophon','credits','keywords','index','index-headnotes','index-legend','index-group','index-entry-list','index-entry','index-term','index-editor-note','index-locator','index-locator-list','index-locator-range','index-xref-preferred','index-xref-related','index-term-category','index-term-categories','glossary','glossterm','glossdef','bibliography','biblioentry','titlepage','halftitlepage','copyright-page','seriespage ','acknowledgments','imprint','imprimatur','contributors','other-credits','errata','dedication','revision-history','case-study','help','marginalia','notice','pullquote','sidebar','warning','halftitle','fulltitle','covertitle','title','subtitle','label','ordinal','bridgehead','learning-objective','learning-objectives','learning-outcome','learning-outcomes','learning-resource','learning-resources','learning-standard','learning-standards','answer','answers','assessment','assessments','feedback','fill-in-the-blank-problem','general-problem','qna','match-problem','multiple-choice-problem','practice','practices','question','true-false-problem','panel','panel-group','balloon','text-area','sound-area','annotation','note','footnote','rearnote','footnotes','rearnotes','annoref','biblioref','glossref','noteref','referrer','credit','keyword','topic-sentence','concluding-sentence','pagebreak','page-list','table','table-row','table-cell','list','list-item','figure')"/> + select="('cover','frontmatter','bodymatter','backmatter','volume','part','chapter','subchapter','division','abstract','foreword','preface','prologue','introduction','preamble','conclusion','epilogue','afterword','epigraph','toc','toc-brief','landmarks','loa','loi','lot','lov','appendix','colophon','credits','keywords','index','index-headnotes','index-legend','index-group','index-entry-list','index-entry','index-term','index-editor-note','index-locator','index-locator-list','index-locator-range','index-xref-preferred','index-xref-related','index-term-category','index-term-categories','glossary','glossterm','glossdef','dictionary','bibliography','biblioentry','titlepage','halftitlepage','copyright-page','seriespage ','acknowledgments','imprint','imprimatur','contributors','other-credits','errata','dedication','revision-history','case-study','help','marginalia','notice','pullquote','sidebar','warning','halftitle','fulltitle','covertitle','title','subtitle','label','ordinal','bridgehead','learning-objective','learning-objectives','learning-outcome','learning-outcomes','learning-resource','learning-resources','learning-standard','learning-standards','answer','answers','assessment','assessments','feedback','fill-in-the-blank-problem','general-problem','qna','match-problem','multiple-choice-problem','practice','practices','question','true-false-problem','panel','panel-group','balloon','text-area','sound-area','annotation','note','footnote','rearnote','footnotes','rearnotes','endnotes','annoref','biblioref','glossref','noteref','referrer','credit','keyword','topic-sentence','concluding-sentence','pagebreak','page-list','table','table-row','table-cell','list','list-item','figure','antonym-group','condensed-entry','def','dictentry','endnote','etymology','example','gram-info','idiom','part-of-speech','part-of-speech-group','part-of-speech-list','phonetic-transcription','phrase-group','phrase-list','sense-group','sense-list','seriespage','synonym-group','tran','tran-info')"/> <xsl:variable name="vocab-z3998-uri" select="'http://www.daisy.org/z3998/2012/vocab/structure/#'"/> <xsl:variable name="vocab-z3998" diff --git a/src/main/resources/xml/xslt/epubcheck-report-to-pipeline-report.xsl b/src/main/resources/xml/xslt/epubcheck-report-to-pipeline-report.xsl index be86fc08..427fcd38 100644 --- a/src/main/resources/xml/xslt/epubcheck-report-to-pipeline-report.xsl +++ b/src/main/resources/xml/xslt/epubcheck-report-to-pipeline-report.xsl @@ -139,7 +139,7 @@ <xsl:for-each select="distinct-values($messages/*/local-name())"> <xsl:variable name="name" select="."/> <xsl:element name="d:{if ($name='exception') then 'exceptions' else if ($name='error') then 'errors' else if ($name='warn') then 'warnings' else 'hints'}"> - <xsl:copy-of select="$messages/*[local-name()=$name]"/> + <xsl:copy-of select="$messages/*[local-name()=$name]" exclude-result-prefixes="#all"/> </xsl:element> </xsl:for-each> </d:report> diff --git a/src/main/resources/xml/xslt/fix-section-hierarchy.xsl b/src/main/resources/xml/xslt/fix-section-hierarchy.xsl index 5edae8ad..430f38d1 100644 --- a/src/main/resources/xml/xslt/fix-section-hierarchy.xsl +++ b/src/main/resources/xml/xslt/fix-section-hierarchy.xsl @@ -5,7 +5,7 @@ <xsl:param name="body-is-section" required="yes"/> <xsl:template match="@*|node()"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> diff --git a/src/main/resources/xml/xslt/generate-missing-headlines.xsl b/src/main/resources/xml/xslt/generate-missing-headlines.xsl index 4a918ee8..0cf6ec74 100644 --- a/src/main/resources/xml/xslt/generate-missing-headlines.xsl +++ b/src/main/resources/xml/xslt/generate-missing-headlines.xsl @@ -12,7 +12,7 @@ <xsl:variable name="translations" select="document('../i18n/translations.xml')/*"/> <xsl:template match="@*|node()"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> @@ -75,7 +75,7 @@ <xsl:message select="$title"/> <xsl:message select="('en',ancestor-or-self::*[@xml:lang|@lang]/(@xml:lang|@lang)[1])[last()]"/> <xsl:variable name="translated-title" select="pf:i18n-translate($title,('en',ancestor-or-self::*[@xml:lang|@lang]/(@xml:lang|@lang)[1])[last()],$translations)"/> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*"/> <xsl:if test="not(h1 | h2 | h3 | h4 | h5 | h6)"> <!-- sectioning element is missing headline; let's generate one! --> diff --git a/src/main/resources/xml/xslt/html-to-opf-metadata.xsl b/src/main/resources/xml/xslt/html-to-opf-metadata.xsl index ceccadc2..fe389859 100644 --- a/src/main/resources/xml/xslt/html-to-opf-metadata.xsl +++ b/src/main/resources/xml/xslt/html-to-opf-metadata.xsl @@ -7,7 +7,7 @@ <xsl:variable name="identifier" select="//html:head/html:meta[lower-case(@name)=('dc:identifier','dct:identifier','dcterms:identifier','dtb:uid')][1]"/> <dc:identifier id="pub-id"> - <xsl:copy-of select="$identifier/@scheme"/> + <xsl:copy-of select="$identifier/@scheme" exclude-result-prefixes="#all"/> <xsl:value-of select="($identifier/@content,replace(replace(string(current-dateTime()),'\+.*',''),'[^\d]',''))[1]"/> </dc:identifier> @@ -37,7 +37,7 @@ <xsl:when test="matches($lcname,'^dc:')"> <xsl:element name="{$lcname}"> <xsl:attribute name="id" select="$id"/> - <xsl:copy-of select="@scheme"/> + <xsl:copy-of select="@scheme" exclude-result-prefixes="#all"/> <xsl:value-of select="@content"/> </xsl:element> <xsl:if test="@role"> @@ -49,14 +49,14 @@ <xsl:when test="matches($lcname,'^dct:') or matches($lcname,'^dcterms:')"> <meta property="{replace($lcname,'^dct:','dcterms:')}"> <xsl:attribute name="id" select="$id"/> - <xsl:copy-of select="@scheme"/> + <xsl:copy-of select="@scheme" exclude-result-prefixes="#all"/> <xsl:value-of select="@content"/> </meta> </xsl:when> <xsl:when test="@name='dtb:narrator'"> <dc:contributor id="{$id}"> <xsl:attribute name="id" select="$id"/> - <xsl:copy-of select="@scheme"/> + <xsl:copy-of select="@scheme" exclude-result-prefixes="#all"/> <xsl:value-of select="@content"/> </dc:contributor> <meta refines="#{$id}" property="role" scheme="marc:relators">nrt</meta> @@ -64,7 +64,7 @@ <xsl:when test="@name='dtb:producer'"> <dc:contributor id="{$id}"> <xsl:attribute name="id" select="$id"/> - <xsl:copy-of select="@scheme"/> + <xsl:copy-of select="@scheme" exclude-result-prefixes="#all"/> <xsl:value-of select="@content"/> </dc:contributor> <meta refines="#{$id}" property="role" scheme="marc:relators">pro</meta> @@ -80,7 +80,7 @@ <xsl:otherwise> <meta property="{@name}"> <xsl:attribute name="id" select="$id"/> - <xsl:copy-of select="@scheme"/> + <xsl:copy-of select="@scheme" exclude-result-prefixes="#all"/> <xsl:value-of select="@content"/> </meta> </xsl:otherwise> diff --git a/src/main/resources/xml/xslt/improve-html-report-readability.xsl b/src/main/resources/xml/xslt/improve-html-report-readability.xsl index 0d8fb87c..18f21e91 100644 --- a/src/main/resources/xml/xslt/improve-html-report-readability.xsl +++ b/src/main/resources/xml/xslt/improve-html-report-readability.xsl @@ -14,23 +14,23 @@ --> <xsl:template match="@* | node()"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="@class[tokenize(.,'\s+')=('error','fatal','exception','message-error','message-fatal','message-exception')]"> - <xsl:copy-of select="."/> + <xsl:copy-of select="." exclude-result-prefixes="#all"/> <xsl:attribute name="style" select="concat(parent::*/@style, 'background-color: #f2dede; ')"/> </xsl:template> <xsl:template match="@class[tokenize(.,'\s+')=('warn','warning','message-warn','message-warning')]"> - <xsl:copy-of select="."/> + <xsl:copy-of select="." exclude-result-prefixes="#all"/> <xsl:attribute name="style" select="concat(parent::*/@style, 'background-color: #fcf8e3; ')"/> </xsl:template> <xsl:template match="li[.//pre[starts-with(text(),'/*')]]"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*"/> <xsl:attribute name="title" select="replace(replace((.//pre[starts-with(text(),'/*')]/text())[1],'\*:',''),'\[namespace[^\]]*\]','')"/> <xsl:apply-templates select="node()"/> @@ -40,7 +40,7 @@ <xsl:template match="pre[starts-with(text(),'/*')]"/> <xsl:template match="h2[ancestor::div[@class='document-validation-report']]"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*"/> <xsl:attribute name="style" select="string-join((@style,'font-size: 24px;'),' ')"/> <xsl:apply-templates select="node()"/> @@ -56,7 +56,7 @@ <xsl:template match="h3[text()='Location (XPath)']" priority="2"/> <xsl:template match="h3[ancestor::div[@class='document-validation-report']]"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*"/> <xsl:attribute name="style" select="string-join((@style,'font-size: 18px;'),' ')"/> <xsl:apply-templates select="node()"/> @@ -64,7 +64,7 @@ </xsl:template> <xsl:template match="p[text()='0 issues found.']"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*"/> <xsl:attribute name="style" select="string-join((@style, 'background-color: #AAFFAA;'),' ')"/> <xsl:apply-templates select="node()"/> @@ -78,7 +78,7 @@ <xsl:variable name="columnNumber" select="replace($parts[starts-with(.,'columnNumber:')][1],'[^\d]','')"/> <xsl:variable name="message" select="string-join($parts[not(starts-with(.,'org.xml.sax.SAXParseException') or starts-with(.,'systemId:') or starts-with(.,'lineNumber:') or starts-with(.,'columnNumber:'))],'; ')"/> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*"/> <xsl:value-of select="$filename"/> <xsl:if test="$lineNumber or $columnNumber"> @@ -96,14 +96,14 @@ <xsl:template match="ul[.//text()[contains(., 'lineNumber')]]"> <p>Note that line numbers tend to be offset by a couple of lines because the doctype and xml declarations are not counted as lines.</p> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="div[@class='document-validation-report' and count(*)=0]" priority="2"/> <xsl:template match="div[@class='document-validation-report']"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@* | node()"/> <hr/> </xsl:copy> diff --git a/src/main/resources/xml/xslt/info-report.xsl b/src/main/resources/xml/xslt/info-report.xsl index 7cf4caa2..6a2a55f3 100644 --- a/src/main/resources/xml/xslt/info-report.xsl +++ b/src/main/resources/xml/xslt/info-report.xsl @@ -29,15 +29,15 @@ </xsl:variable> <xsl:for-each select="$types/*"> <xsl:sort select="xs:integer(@content)"/> - <xsl:copy-of select="."/> + <xsl:copy-of select="." exclude-result-prefixes="#all"/> </xsl:for-each> <xsl:for-each select="$classes/*"> <xsl:sort select="xs:integer(@content)"/> - <xsl:copy-of select="."/> + <xsl:copy-of select="." exclude-result-prefixes="#all"/> </xsl:for-each> <xsl:for-each select="$elements/*"> <xsl:sort select="xs:integer(@content)"/> - <xsl:copy-of select="."/> + <xsl:copy-of select="." exclude-result-prefixes="#all"/> </xsl:for-each> </d:properties> </d:document-info> diff --git a/src/main/resources/xml/xslt/make-uris-relative-to-document.xsl b/src/main/resources/xml/xslt/make-uris-relative-to-document.xsl index b9e4b535..1b857f5f 100644 --- a/src/main/resources/xml/xslt/make-uris-relative-to-document.xsl +++ b/src/main/resources/xml/xslt/make-uris-relative-to-document.xsl @@ -5,7 +5,7 @@ <xsl:variable name="doc-base" select="if (/html/head/base[@href][1]) then resolve-uri(normalize-space(/html/head/base[@href][1]/@href),base-uri(/*)) else base-uri(/*)"/> <xsl:template match="/*|@*|node()"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> @@ -18,7 +18,7 @@ <xsl:attribute name="{name()}" select="concat('#',substring-after(.,'#'))"/> </xsl:when> <xsl:otherwise> - <xsl:copy-of select="."/> + <xsl:copy-of select="." exclude-result-prefixes="#all"/> </xsl:otherwise> </xsl:choose> </xsl:template> diff --git a/src/main/resources/xml/xslt/navdoc-nordic-normalization.xsl b/src/main/resources/xml/xslt/navdoc-nordic-normalization.xsl index 509fbd7e..21274e90 100644 --- a/src/main/resources/xml/xslt/navdoc-nordic-normalization.xsl +++ b/src/main/resources/xml/xslt/navdoc-nordic-normalization.xsl @@ -1,27 +1,35 @@ <?xml version="1.0" encoding="UTF-8"?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="#all" version="2.0" xmlns:epub="http://www.idpf.org/2007/ops" - xmlns="http://www.w3.org/1999/xhtml" xpath-default-namespace="http://www.w3.org/1999/xhtml"> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:epub="http://www.idpf.org/2007/ops" + xmlns:f="http://www.daisy.org/ns/pipeline/internal-functions" + xmlns="http://www.w3.org/1999/xhtml" + xpath-default-namespace="http://www.w3.org/1999/xhtml" + exclude-result-prefixes="#all" + version="2.0"> <xsl:param name="identifier" required="yes"/> <xsl:param name="title" required="yes"/> <xsl:param name="supplier" select="''"/> <xsl:param name="publisher" required="yes"/> <xsl:variable name="lang" select="string((/html/head/meta[@name='dc:language']/@content, /*/@xml:lang, /*/@lang)[1])"/> + + <xsl:include href="update-epub-prefixes.xsl"/> <xsl:template match="@*|node()"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:apply-templates select="@*[not(name()=('lang','xml:lang'))] | node()"/> </xsl:copy> </xsl:template> <xsl:template match="/*"> - <xsl:copy> + <xsl:copy exclude-result-prefixes="#all"> <xsl:namespace name="epub" select="'http://www.idpf.org/2007/ops'"/> - <xsl:namespace name="nordic" select="'http://www.mtm.se/epub/'"/> <xsl:apply-templates select="@*[not(name()=('lang','xml:lang'))]"/> <xsl:attribute name="xml:lang" select="$lang"/> <xsl:attribute name="lang" select="$lang"/> - <xsl:attribute name="epub:prefix" select="'z3998: http://www.daisy.org/z3998/2012/vocab/structure/#'"/> + <xsl:variable name="prefixes" select="f:prefixes(/*/head, /*/body, 'nordic')"/> + <xsl:attribute name="epub:prefix" select="string-join($prefixes, ' ')"/> <xsl:apply-templates select="node()"/> </xsl:copy> </xsl:template> diff --git a/src/main/resources/xml/xslt/navdoc-to-outline.xsl b/src/main/resources/xml/xslt/navdoc-to-outline.xsl index e149500f..86e6db12 100644 --- a/src/main/resources/xml/xslt/navdoc-to-outline.xsl +++ b/src/main/resources/xml/xslt/navdoc-to-outline.xsl @@ -10,11 +10,13 @@ </xsl:template> <xsl:template match="/*"> - <xsl:copy> - <xsl:attribute name="xml:base" select="base-uri(/*)"/> - <xsl:attribute name="epub:prefix" select="'z3998: http://www.daisy.org/z3998/2012/vocab/structure/#'"/> - <xsl:namespace name="nordic" select="'http://www.mtm.se/epub/'"/> + <xsl:copy exclude-result-prefixes="#all"> + <xsl:copy-of select="(/* | opf:*)/namespace::*[not(.=('http://www.idpf.org/2007/opf','http://purl.org/dc/elements/1.1/','http://purl.org/dc/terms/'))]"/> <xsl:namespace name="epub" select="'http://www.idpf.org/2007/ops'"/> + <xsl:attribute name="xml:base" select="base-uri(/*)"/> + <xsl:if test="@prefix"> + <xsl:attribute name="epub:prefix" select="string-join((/* | opf:*)/@prefix, ' ')"/> + </xsl:if> <head/> <body> @@ -23,8 +25,8 @@ <xsl:variable name="basedir" select="replace(base-uri(),'[^/]+$','')"/> <xsl:variable name="spine-annotated"> <xsl:for-each select="$spine"> - <xsl:copy> - <xsl:copy-of select="@*"/> + <xsl:copy exclude-result-prefixes="#all"> + <xsl:copy-of select="@*" exclude-result-prefixes="#all"/> <xsl:attribute name="level" select="pf:outline-level($spine, $toc, position())"/> </xsl:copy> </xsl:for-each> @@ -95,7 +97,7 @@ <xsl:template match="span"> <xsl:element name="{concat('h',min((count(ancestor::li),6)))}"> - <xsl:copy-of select="(@*|node())"/> + <xsl:copy-of select="(@*|node())" exclude-result-prefixes="#all"/> </xsl:element> </xsl:template> diff --git a/src/main/resources/xml/xslt/opf-to-html-metadata.xsl b/src/main/resources/xml/xslt/opf-to-html-metadata.xsl index 20863721..bd4e8780 100644 --- a/src/main/resources/xml/xslt/opf-to-html-metadata.xsl +++ b/src/main/resources/xml/xslt/opf-to-html-metadata.xsl @@ -11,15 +11,18 @@ <xsl:template match="opf:metadata"> <xsl:text> </xsl:text> - <head xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:nordic="http://www.mtm.se/epub/"> - <xsl:copy-of select="namespace::*[not(.=('http://www.w3.org/1999/xhtml','http://www.idpf.org/2007/opf'))]"/> + <head xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:nordic="http://www.mtm.se/epub/" xmlns:epub="http://www.idpf.org/2007/ops"> + <xsl:copy-of select="namespace::*[not(.=('http://www.w3.org/1999/xhtml','http://www.idpf.org/2007/opf'))]" exclude-result-prefixes="#all"/> + <xsl:if test="count(ancestor-or-self::*/@prefix)"> + <xsl:attribute name="epub:prefix" select="string-join(ancestor-or-self::*/@prefix, ' ')"/> + </xsl:if> <xsl:text> </xsl:text> <meta charset="UTF-8"/> <xsl:text> </xsl:text> <title> - <xsl:copy-of select="dc:title[1]/(@scheme|@http-equiv|@xml:lang|@dir|namespace::*[not(.=('http://www.w3.org/1999/xhtml','http://www.idpf.org/2007/opf'))]|node())"/> + <xsl:copy-of select="dc:title[1]/(@scheme|@http-equiv|@xml:lang|@dir|namespace::*[not(.=('http://www.w3.org/1999/xhtml','http://www.idpf.org/2007/opf'))]|node())" exclude-result-prefixes="#all"/> @@ -37,7 +40,7 @@ - + @@ -46,7 +49,7 @@ - + diff --git a/src/main/resources/xml/xslt/pretty-print.xsl b/src/main/resources/xml/xslt/pretty-print.xsl index 7561915f..a5f16819 100644 --- a/src/main/resources/xml/xslt/pretty-print.xsl +++ b/src/main/resources/xml/xslt/pretty-print.xsl @@ -22,7 +22,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -49,7 +49,7 @@ - + diff --git a/src/main/resources/xml/xslt/replace-sections-with-documents.xsl b/src/main/resources/xml/xslt/replace-sections-with-documents.xsl index 4f3ca479..78b3b109 100644 --- a/src/main/resources/xml/xslt/replace-sections-with-documents.xsl +++ b/src/main/resources/xml/xslt/replace-sections-with-documents.xsl @@ -1,9 +1,16 @@ - + + + @@ -27,6 +34,19 @@ + + + + + + + + + + + + + diff --git a/src/main/resources/xml/xslt/replace-single-html-hrefs-with-multi-html-hrefs.xsl b/src/main/resources/xml/xslt/replace-single-html-hrefs-with-multi-html-hrefs.xsl index 11830197..379e9dcd 100644 --- a/src/main/resources/xml/xslt/replace-single-html-hrefs-with-multi-html-hrefs.xsl +++ b/src/main/resources/xml/xslt/replace-single-html-hrefs-with-multi-html-hrefs.xsl @@ -9,7 +9,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/src/main/resources/xml/xslt/split-html.annotate.xsl b/src/main/resources/xml/xslt/split-html.annotate.xsl index 6b41eeda..f3cb9e53 100644 --- a/src/main/resources/xml/xslt/split-html.annotate.xsl +++ b/src/main/resources/xml/xslt/split-html.annotate.xsl @@ -13,39 +13,39 @@ - - + + - + - - + + - + - + - + - + - + diff --git a/src/main/resources/xml/xslt/split-html.xsl b/src/main/resources/xml/xslt/split-html.xsl index 66500fa4..a35cda22 100644 --- a/src/main/resources/xml/xslt/split-html.xsl +++ b/src/main/resources/xml/xslt/split-html.xsl @@ -1,13 +1,23 @@ - + + - + @@ -17,23 +27,28 @@ + - - + + + + + + - + - + @@ -84,7 +99,7 @@ - + diff --git a/src/main/resources/xml/xslt/update-epub-prefixes.xsl b/src/main/resources/xml/xslt/update-epub-prefixes.xsl new file mode 100644 index 00000000..abb7e89c --- /dev/null +++ b/src/main/resources/xml/xslt/update-epub-prefixes.xsl @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/C00000.epub b/src/test/resources/C00000.epub index e723eb2ef3f5f86456e3d3808dc029a368057a4b..acef29930c0dac45616c840cf21a0fbd01f3f44a 100644 GIT binary patch delta 2587 zcmV+$3gq>#?-IxF5|Bg$M~5p-lY#velgHL3f5p|V*R~W&p4xTCp7BmR@ur?mCiQ?M zB%%uv3;;?ick(WIkY2Sf*6)DSuBe|~NltPRT}T9Re!laA0~{!Rep4tm6UItij)H#g zG+?4kbtcQ{DER*BZ{f4x`S?*xWMQE*p;&IjWEAAiRl_Kn&*#02OS|Z4GmR=)2_;Jr ze}S@A!bYVwnM~WCFn5Kz=$Uf*tBE{2?O%lbo=tNv@{7NI`||1^?_M#|gfaavs3~nn z`uyCB?hgio=!R&5hG;0NI_Xf#teSY*v(wY3k*=(#94b!U5oN&co``o?!4P>f3O=0= z2G53Ut3`ee0{dstOs71FtTT1$Y9pdQe=*+gFFJg;2uOa*Q1SGdPenw;;DPm`;I~}O z(DMY37(R_{jl(+D6|U%6(MS%)o;J<}&zeU+EQI4M&AG9{E%SjzD+EqDCB}c}N|a8P z>^1-2e-su!lsjY@n`q$_meNVCq%Hp4nV?Tdp$%;%fB1FCEhGu0LS4IWI+QgrzRUrsy@Q zAyM5Y*6~D%A5z7wW&a$pz>h;iOF9gGJlRS6XV9`P@g|rAxh+f+*P+X0`OPj8k9e5N z3|VwMTv+SA?5(~d^S?UCiXAd`8kcINcxA#NfoVfA2wHNxaJy-Yj-lZER%DwA{Vb9aC}}u{_Z;@qk<$%W%eS zQFnh1Q~3>jw3(0((a)3yJkixG)XjLb0N^Kt+zkTy#O8~o~FWDf0;-n-J<6wqpjl5 zCe4#II_RH@CxgfB zjX+}(%{J;;D{G~Vi!(X%tQDI2j~8eYso*t392HH$RYw@TPYilGIE;GdQE(BA;|Nk# zWaj-(~O_g;q&g7F&$i&N}R z1|D)byh7d;e~sf{1j%Etb!>rtra&XfP(g0 zrfVkCSE*46CU`1QaR?_FQwbw=wsdr%4YhC30C;Qxe-~NGEiA0YEw)0=k{`aSQL}h& z9U&IQzDwe~@1f&BV}TzqfIR0jAVPX;N@~u^x=5P!U^W)`@P6I3y3=&FcC&=4xRTAZ zHa8-%hV?ucf5^3uTzB0*-x{PX5+0KT#3O?g!LCa^zs(4XOqz)2TcaH*c^~%krw?Pl zXf+#+f9%Xq=_u-oFP7=-*BWIg+>H39Sh2gx&ruj3pFfNdRr~{d3q1g%)B=a+ead0L zF!H(Gq`9Ua%2>?`!m?GS}+RrJ$i9haag!aVZ55~)WLH#d_>YpgxS?jY;mSz?*xjqO=>gU z!-_bn)yn9LFl3j=#ml!$-0-5pI>NE5@PA9#VH9OzhRy^ftXJqy*r=MnC`1{4|31oe ze`=!-B8eIS(W^#)ZO0$qEs&#AlwDqa#6FFOf`wtHh<-r*hEzs11I2OXvz-y62BYLY zw}^4LUVdYXd@HBp_c-T>0%ePitNzW9y`f#$-wMEaQ$_m)$(k;=VEa?eX-PF3L%ygq zwgenD7-AwYr2||^w#0Y9(28#00*Uc!g#ZgnG)0HJd%>K zHT4*lG4|B_-oL+|dH=Rf4j5OC&fcSd82wNdQyfqV95`(>YfF0XU)2=n&BEw8zHJQ$ z7IMshFOKjK7v=a2PbJQNewM|B9<#4$R@2~?Be|Dhw8@a}WQaT(`UUdwh6`WQe_Cyw zWYNkXLFw-l`p=UR|MeAeHc>jgZvLUUacep9TRO74z`Pxsg<$*ZW{Nzpb*h<`WA43n z56RM<+Z9B+HBg|w_F*~}Tk@M=YxCjJHoT+lc;ox5l;d<|4O9KQ7005W%t^^mCBd-J>v3E@tv(y&azk@*E zhd|!}hd|!~w?N+m!OtH@hbv8!OA{?{2mk<{9{>Ox00000000000000006LSu)*qLQ zuLKO20j~re0`v%%A+H2W0(>8rZm$GL0(Cl1AkwFc2kTL*cmZn_3BHqzr1<)TWq-CA_s6KwRpQ%r_P5~9Pz zU_JWbLM$D}#{-v{{_I|y@GJUk%_SA8#1Jv;)uQ)m6=91-?wo!nxAo0VtXSyYMHU5T z+ao)|x!49q(W)8!?kJ0aymZ4!(|N}+-5!&UEZ^j^z&yAtY3rIaqDWTQ3LdSL=uy!4 zyo__Act^PTXubMc>G|$~mdoXzB`XlRG7dKO z_q~dJ)+H}K!-naxm({Dy^L>)j`@)2NxqN!I^w6)edr-$^8zr5w_ICj>G`|PoruVa8 zmZg0(#!CkA$f{1ETv*&DP;RfnSSb9YlBf!=VT#bkBB>d$c+h149`k~)v2Nt+K|Ka`w(kEk1D5&+4 zB6};}73aj_Tr9%a=`8YIOlg8H&!po{T7r`it4VBKAc|c4$5{iEIR~*a_ZW~U4iQt< zCs;5(UDG7KC@}e%An7l2vYc=snwQ%Vjoex2F`Lvvzb;`7h%ru_YO4t3tI@S3ZwT)` zy%_r;QNOD_wsNb_^Z07&`KXTVMgs9;jj2?pj}-0mw1qiEPyk@x&)ohtc#E0sZyF)a z<|~Ww%qaiEEspZ}uv?4lONb&3!HBnaAlaiPUojB9m?;hBs=M_}w{($w>Z<%yXd;SNyPNio%S(xBY6}H{&!TFILUoXQjb@xx16d z;IYB6li1ITKeS zha`vn*Td@c28~anFic5l#V%S(ZI%ltZ=`NO9Q^=~Sn5E%kxpLHRT7i4|NBDa@}$1C zzOaF;3ukj(=VxvG9nqazmcq|+4E>;DL=f8{8f@I|eTd7dEpg0}-As3;#Y=^=z!h-L z7@n#hu5))c8{1xlUFtY0m#^cH@O>|{@L98@d!jgDh3GLk{l~>YzFXlqT~z%&CFZ@U_NLzd)G7t!k1s7H zB&BG_bNxMU@A%^h^3anv63^qsS?6SU*ND16s}Z^SH6`6iqL=R2_)FvX+^Nexu63T_ z1p5esfDjVG^w(8iiy#p?+-0bp$8-C)yksc( zc8F)hRac%Rvlh90(ZfJrKbgC$#@|23dAIlPb9C+?+{>bxUZyS=$dO!?OcNdOH82QU z1zEvKF*O<*ZzA{JIriC2)t(ebuA*#~F?5 z#D_k%XFHLN`<8)uK@)!=x`k>l#{3c8YKdeK>>WLc8JO1lHJNr)qe8< z{;}!p>kCwmsL^?uDixO_nLp!~!`Lyg&)MGNOD6<_%=xo9J%dk3}>@w0Fo{^C=eLtv5LzZDX2O<+KVB{~c*jq~(gAKl>J2*tSjX ztR3+Ec{?{yN-!EVaj9(PsC^0+6cSV3_wMrNfZz&Ag9Jvs_o zf3F>sapf%r$sNMvw>>L-1F#&uiJXPECe1S=Y_425>4^xsGHQ zDp*$K^S47=GaRQ+8rMcns)K`CYJx%z_-Q*g4^;c=5}?m0(?}xWVo+%G7o_wz6IjWFu0vVgsm61k|Y$ zTfk@{ph~UZ4b~8W8`Mn$;69OZbJhr`Sq?}D{$CsVw?X|9xnm%Vk_Wt3PI*e1jP)i{ z+EN)MObNw+u!A4U0XQTa~tAdgx z_!K*L$`6KAQ1X@h(vn~gMbk*rKtLo7L;?K0l0y3E|Bx(*t^}^rxOq|kI)j3Xzi3jE z=D!5fqWKN{qw3di4aKUVfq_*Ng1iFfssI?I8RV%3^dU7MvKml^kinE{K$5n(6rg - diff --git a/src/test/resources/DTBook/C00000.xml b/src/test/resources/DTBook/C00000.xml index 01c69792..cf680f5b 100644 --- a/src/test/resources/DTBook/C00000.xml +++ b/src/test/resources/DTBook/C00000.xml @@ -3,7 +3,7 @@ - + diff --git a/src/test/resources/single-html/C00000.xhtml b/src/test/resources/single-html/C00000.xhtml index c2b5b800..93e7bf72 100644 --- a/src/test/resources/single-html/C00000.xhtml +++ b/src/test/resources/single-html/C00000.xhtml @@ -2,7 +2,7 @@ - diff --git a/src/test/xprocspec/dtbook-to-epub3.xprocspec b/src/test/xprocspec/dtbook-to-epub3.xprocspec index 25a14914..e2e97284 100644 --- a/src/test/xprocspec/dtbook-to-epub3.xprocspec +++ b/src/test/xprocspec/dtbook-to-epub3.xprocspec @@ -41,8 +41,6 @@ label="There should be exactly four namespaces declared on the root element (the default namespace, nordic, epub and the implicit xml namespace)"/> - - + ... ... @@ -92,8 +92,8 @@ - - ... + + ... @@ -4274,5 +4274,12 @@ + + + + + + + diff --git a/src/test/xspec/navdoc-to-outline.xspec b/src/test/xspec/navdoc-to-outline.xspec index 4e578cb1..2234d661 100644 --- a/src/test/xspec/navdoc-to-outline.xspec +++ b/src/test/xspec/navdoc-to-outline.xspec @@ -4,8 +4,7 @@ - +
@@ -23,8 +22,7 @@ - +
diff --git a/src/test/xspec/opf-to-html-metadata.xspec b/src/test/xspec/opf-to-html-metadata.xspec index 7695e25b..8aec6334 100644 --- a/src/test/xspec/opf-to-html-metadata.xspec +++ b/src/test/xspec/opf-to-html-metadata.xspec @@ -1,12 +1,14 @@ - + - + Valentin Haüy - the father of the education for the blind diff --git a/src/test/xspec/replace-sections-with-documents.xspec b/src/test/xspec/replace-sections-with-documents.xspec index 3212d371..902eda6a 100644 --- a/src/test/xspec/replace-sections-with-documents.xspec +++ b/src/test/xspec/replace-sections-with-documents.xspec @@ -5,8 +5,7 @@ - +
@@ -45,7 +44,7 @@
- + cover @@ -55,7 +54,7 @@

lorem ipsum

- + introduction @@ -65,7 +64,7 @@

lorem ipsum

- + rearnotes @@ -75,7 +74,7 @@

lorem ipsum

- + chapter @@ -85,7 +84,7 @@

lorem ipsum

- + part @@ -95,7 +94,7 @@

lorem ipsum

- + rearnotes @@ -105,7 +104,7 @@

lorem ipsum

- + introduction @@ -115,7 +114,7 @@

lorem ipsum

- + rearnotes @@ -125,7 +124,7 @@

lorem ipsum

- + chapter @@ -135,9 +134,10 @@

lorem ipsum

- + rearnotes + @@ -145,7 +145,7 @@

lorem ipsum

- + part @@ -155,7 +155,7 @@

lorem ipsum

- + chapter @@ -165,7 +165,7 @@

lorem ipsum

- + part @@ -175,7 +175,7 @@

lorem ipsum

- + chapter @@ -185,7 +185,7 @@

lorem ipsum

- + chapter @@ -195,7 +195,7 @@

lorem ipsum

- + rearnotes @@ -205,7 +205,7 @@

lorem ipsum

- + chapter @@ -215,7 +215,7 @@

lorem ipsum

- + part @@ -225,7 +225,7 @@

lorem ipsum

- + part @@ -235,7 +235,7 @@

lorem ipsum

- + chapter @@ -245,7 +245,7 @@

lorem ipsum

- + rearnotes @@ -255,7 +255,7 @@

lorem ipsum

- + chapter @@ -265,7 +265,7 @@

lorem ipsum

- + index @@ -275,7 +275,7 @@

lorem ipsum

- + rearnotes @@ -285,7 +285,7 @@

lorem ipsum

- + footnotes @@ -298,8 +298,7 @@ - +
diff --git a/src/test/xspec/split-html.xspec b/src/test/xspec/split-html.xspec index 5cd3e755..c3a7a7d6 100644 --- a/src/test/xspec/split-html.xspec +++ b/src/test/xspec/split-html.xspec @@ -1,12 +1,16 @@ - - + + - + Single-page title +
@@ -16,6 +20,7 @@

titlepage

titlepagetitlepagetitlepage

+

author

colophon

@@ -78,9 +83,10 @@ - + Single-page title + @@ -88,20 +94,23 @@

covercovercover

- + Single-page title +

titlepage

titlepagetitlepagetitlepage

+

author

- + Single-page title + @@ -110,9 +119,10 @@

colophoncolophoncolophon

- + Single-page title + @@ -121,9 +131,10 @@

toctoctoc

- + Single-page title + @@ -132,9 +143,10 @@

partpartpart

- + Single-page title + @@ -143,9 +155,10 @@

chapterchapterchapter

- + Single-page title + @@ -154,9 +167,10 @@

chapterchapterchapter

- + Single-page title + @@ -165,9 +179,10 @@

partpartpart

- + Single-page title + @@ -176,9 +191,10 @@

chapterchapterchapter

- + Single-page title + @@ -187,9 +203,10 @@

chapterchapterchapter

- + Single-page title + @@ -198,9 +215,10 @@

indexindexindex

- + Single-page title + @@ -209,9 +227,10 @@

appendixappendixappendix

- + Single-page title + @@ -220,9 +239,10 @@

appendixappendixappendix

- + Single-page title + @@ -231,9 +251,10 @@

glossaryglossaryglossary

- + Single-page title + @@ -242,9 +263,10 @@

footnotesfootnotesfootnotes

- + Single-page title + @@ -258,7 +280,7 @@ - + Single-page title @@ -283,7 +305,7 @@ - + Single-page title @@ -300,7 +322,7 @@ - + Single-page title diff --git a/src/test/xspec/update-epub-prefixes.xspec b/src/test/xspec/update-epub-prefixes.xspec new file mode 100644 index 00000000..789dc465 --- /dev/null +++ b/src/test/xspec/update-epub-prefixes.xspec @@ -0,0 +1,72 @@ + + + + + + + + + + + + +

+ + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +