Skip to content

Commit

Permalink
nota specific changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ybk committed Jun 3, 2015
1 parent 100b5ab commit 44bc40b
Show file tree
Hide file tree
Showing 8 changed files with 2,993 additions and 31 deletions.
2 changes: 2 additions & 0 deletions src/main/resources/META-INF/catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<uri name="http://www.daisy.org/pipeline/modules/nordic/nordic-dtbook-2005-3.rng" uri="../xml/schema/nordic-dtbook-2005-3.rng"/>
<uri name="http://www.daisy.org/pipeline/modules/nordic/nordic-html5.rng" uri="../xml/schema/nordic-html5.rng"/>
<uri name="http://www.daisy.org/pipeline/modules/nordic/mtm2015-1.sch" uri="../xml/schema/mtm2015-1.sch"/>
<uri name="http://www.daisy.org/pipeline/modules/nordic/mtm2015-1.nota.sch" uri="../xml/schema/mtm2015-1.nota.sch"/>
<uri name="http://www.daisy.org/pipeline/modules/nordic/nordic2015-1.sch" uri="../xml/schema/nordic2015-1.sch"/>
<uri name="http://www.daisy.org/pipeline/modules/nordic/nordic2015-1.nota.sch" uri="../xml/schema/nordic2015-1.nota.sch"/>
<uri name="http://www.daisy.org/pipeline/modules/nordic/nordic2015-1.opf.sch" uri="../xml/schema/nordic2015-1.opf.sch"/>
<uri name="http://www.daisy.org/pipeline/modules/nordic/nordic2015-1.opf-and-html.sch" uri="../xml/schema/nordic2015-1.opf-and-html.sch"/>
<uri name="http://www.daisy.org/pipeline/modules/nordic/nordic2015-1.nav-references.sch" uri="../xml/schema/nordic2015-1.nav-references.sch"/>
Expand Down
640 changes: 640 additions & 0 deletions src/main/resources/xml/schema/mtm2015-1.nota.sch

Large diffs are not rendered by default.

1,159 changes: 1,159 additions & 0 deletions src/main/resources/xml/schema/nordic2015-1.nota-single-file.sch

Large diffs are not rendered by default.

1,160 changes: 1,160 additions & 0 deletions src/main/resources/xml/schema/nordic2015-1.nota.sch

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/resources/xml/xproc/step/dtbook-validate.step.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<p:empty/>
</p:input>
<p:input port="schema">
<p:document href="../../schema/mtm2015-1.sch"/>
<p:document href="../../schema/mtm2015-1.nota.sch"/>
</p:input>
</p:validate-with-schematron>
<p:sink/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/xml/xproc/step/html-validate.step.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<p:empty/>
</p:input>
<p:input port="schema">
<p:document href="../../schema/nordic2015-1.sch"/>
<p:document href="../../schema/nordic2015-1.nota.sch"/>
</p:input>
</p:validate-with-schematron>
<p:sink/>
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/xml/xslt/epub3-to-dtbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<xsl:variable name="vocab-z3998"
select="('abbreviations','acknowledgments','acronym','actor','afterword','alteration','annoref','annotation','appendix','article','aside','attribution','author','award','backmatter','bcc','bibliography','biographical-note','bodymatter','cardinal','catalogue','cc','chapter','citation','clarification','collection','colophon','commentary','commentator','compound','concluding-sentence','conclusion','continuation','continuation-of','contributors','coordinate','correction','covertitle','currency','decimal','decorative','dedication','diary','diary-entry','discography','division','drama','dramatis-personae','editor','editorial-note','email','email-message','epigraph','epilogue','errata','essay','event','example','family-name','fiction','figure','filmography','footnote','footnotes','foreword','fraction','from','frontispiece','frontmatter','ftp','fulltitle','gallery','general-editor','geographic','given-name','glossary','grant-acknowledgment','grapheme','halftitle','halftitle-page','help','homograph','http','hymn','illustration','image-placeholder','imprimatur','imprint','index','initialism','introduction','introductory-note','ip','isbn','keyword','letter','loi','lot','lyrics','marginalia','measure','mixed','morpheme','name-title','nationality','non-fiction','nonresolving-citation','nonresolving-reference','note','noteref','notice','orderedlist','ordinal','organization','other-credits','pagebreak','page-footer','page-header','part','percentage','persona','personal-name','pgroup','phone','phoneme','photograph','phrase','place','plate','poem','portmanteau','postal','postal-code','postscript','practice','preamble','preface','prefix','presentation','primary','product','production','prologue','promotional-copy','published-works','publisher-address','publisher-logo','range','ratio','rearnote','rearnotes','recipient','recto','reference','republisher','resolving-reference','result','role-description','roman','root','salutation','scene','secondary','section','sender','sentence','sidebar','signature','song','speech','stage-direction','stem','structure','subchapter','subject','subsection','subtitle','suffix','surname','taxonomy','tertiary','text','textbook','t-form','timeline','title','title-page','to','toc','topic-sentence','translator','translator-note','truncation','unorderedlist','valediction','verse','verso','v-form','volume','warning','weight','word')"/>
<xsl:variable name="special-classes"
select="('part','cover','colophon','nonstandardpagination','jacketcopy','frontcover','rearcover','leftflap','rightflap','precedingemptyline','precedingseparator','indented','asciimath','byline','dateline','address','definition','keyboard','initialism','truncation','cite','bdo','quote','exercisenumber','exercisepart','answer','answer_1','box')"/>
select="('part','cover','colophon','nonstandardpagination','jacketcopy','frontcover','rearcover','leftflap','rightflap','precedingemptyline','precedingseparator','indented','asciimath','byline','dateline','address','definition','keyboard','initialism','truncation','cite','bdo','quote','exercisenumber','exercisepart','answer','answer_1','box','note_identifier')"/>

<xsl:template match="text()|comment()">
<xsl:copy-of select="."/>
Expand Down Expand Up @@ -442,6 +442,7 @@
<xsl:call-template name="attrsrqd">
<xsl:with-param name="except-classes" select="'*'" tunnel="yes"/>
</xsl:call-template>
<xsl:attribute name="class" select="if (f:types(.)='footnote') then 'footnote required' else if (f:types(.)='rearnote') then 'rearnote required' else ('')"/>
</xsl:template>

<!-- <annotation> is not allowed in nordic DTBook. Replacing with p. -->
Expand Down
56 changes: 28 additions & 28 deletions src/test/xspec/epub3-to-dtbook.xspec
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@
<html:aside epub:type="note"/>
</x:context>
<x:expect label="the resulting element should be a note">
<dtbook:note/>
<dtbook:note class=""/>
</x:expect>
</x:scenario>

Expand Down Expand Up @@ -2793,47 +2793,47 @@
<dtbook:frontmatter>
<dtbook:level1 id="frontmatter-notes">
<dtbook:h1>notes</dtbook:h1>
<dtbook:note id="fn_ch1_1">
<dtbook:note id="fn_ch1_1" class="">
<dtbook:p>1. G.D.H. Cole in Horowitz, <dtbook:em>The Anarchists</dtbook:em> (New York: Dell Publishing, 1964).</dtbook:p>
</dtbook:note>
<dtbook:note id="fn_ch1_2">
<dtbook:note id="fn_ch1_2" class="">
<dtbook:p>2. G. Woodcock, <dtbook:em>Anarchism</dtbook:em> (Harmondsworth: Penguin, 1979), 8&#x2013;9.</dtbook:p>
</dtbook:note>
<dtbook:pagenum page="normal" id="page-40">40</dtbook:pagenum>
<dtbook:note id="fn_ch1_3">
<dtbook:note id="fn_ch1_3" class="">
<dtbook:p>3. <dtbook:em>Dictionnaire de L Acad&#x00E9;mie Fran&#x00E7;aise</dtbook:em> at http://colet.uhicago.edu/cgi-bin</dtbook:p>
</dtbook:note>
</dtbook:level1>
</dtbook:frontmatter>
<dtbook:bodymatter>
<dtbook:level1 id="rearnotes" class="rearnotes">
<dtbook:h1>notes</dtbook:h1>
<dtbook:note id="fn_ch1_1">
<dtbook:note id="fn_ch1_1" class="rearnote required">
<dtbook:p>1. G.D.H. Cole in Horowitz, <dtbook:em>The Anarchists</dtbook:em> (New York: Dell Publishing, 1964).</dtbook:p>
</dtbook:note>
<dtbook:note id="fn_ch1_2">
<dtbook:note id="fn_ch1_2" class="rearnote required">
<dtbook:p>2. G. Woodcock, <dtbook:em>Anarchism</dtbook:em> (Harmondsworth: Penguin, 1979), 8&#x2013;9.</dtbook:p>
<dtbook:pagenum page="normal" id="page-40">40</dtbook:pagenum>
</dtbook:note>
<dtbook:note id="fn_ch1_3">
<dtbook:note id="fn_ch1_3" class="rearnote required">
<dtbook:p>3. <dtbook:em>Dictionnaire de L Acad&#x00E9;mie Fran&#x00E7;aise</dtbook:em> at http://colet.uhicago.edu/cgi-bin</dtbook:p>
</dtbook:note>
<dtbook:p>Paragraph</dtbook:p>
<dtbook:note id="fn_ch1_3_2">
<dtbook:note id="fn_ch1_3_2" class="rearnote required">
<dtbook:p>3. <dtbook:em>Dictionnaire de L Acad&#x00E9;mie Fran&#x00E7;aise</dtbook:em> at http://colet.uhicago.edu/cgi-bin</dtbook:p>
</dtbook:note>
</dtbook:level1>
<dtbook:level1 id="bodymatter-notes" class="chapter">
<dtbook:h1>notes</dtbook:h1>
<dtbook:div>
<dtbook:note id="fn_ch1_1">
<dtbook:note id="fn_ch1_1" class="">
<dtbook:p>1. G.D.H. Cole in Horowitz, <dtbook:em>The Anarchists</dtbook:em> (New York: Dell Publishing, 1964).</dtbook:p>
</dtbook:note>
<dtbook:note id="fn_ch1_2">
<dtbook:note id="fn_ch1_2" class="">
<dtbook:p>2. G. Woodcock, <dtbook:em>Anarchism</dtbook:em> (Harmondsworth: Penguin, 1979), 8&#x2013;9.</dtbook:p>
</dtbook:note>
<dtbook:pagenum page="normal" id="page-40">40</dtbook:pagenum>
<dtbook:note id="fn_ch1_3">
<dtbook:note id="fn_ch1_3" class="">
<dtbook:p>3. <dtbook:em>Dictionnaire de L Acad&#x00E9;mie Fran&#x00E7;aise</dtbook:em> at http://colet.uhicago.edu/cgi-bin</dtbook:p>
</dtbook:note>
</dtbook:div>
Expand All @@ -2843,14 +2843,14 @@
<dtbook:p>Paragraph</dtbook:p>
<dtbook:level2 id="rearnotes" class="rearnotes">
<dtbook:h2>notes</dtbook:h2>
<dtbook:note id="fn_ch1_1">
<dtbook:note id="fn_ch1_1" class="rearnote required">
<dtbook:p>1. G.D.H. Cole in Horowitz, <dtbook:em>The Anarchists</dtbook:em> (New York: Dell Publishing, 1964).</dtbook:p>
</dtbook:note>
<dtbook:note id="fn_ch1_2">
<dtbook:note id="fn_ch1_2" class="rearnote required">
<dtbook:p>2. G. Woodcock, <dtbook:em>Anarchism</dtbook:em> (Harmondsworth: Penguin, 1979), 8&#x2013;9.</dtbook:p>
<dtbook:pagenum page="normal" id="page-40">40</dtbook:pagenum>
</dtbook:note>
<dtbook:note id="fn_ch1_3">
<dtbook:note id="fn_ch1_3" class="rearnote required">
<dtbook:p>3. <dtbook:em>Dictionnaire de L Acad&#x00E9;mie Fran&#x00E7;aise</dtbook:em> at http://colet.uhicago.edu/cgi-bin</dtbook:p>
</dtbook:note>
</dtbook:level2>
Expand All @@ -2859,33 +2859,33 @@
<dtbook:rearmatter>
<dtbook:level1 id="footnotes" class="footnotes">
<dtbook:h1>notes</dtbook:h1>
<dtbook:note id="fn_ch1_1">
<dtbook:note id="fn_ch1_1" class="footnote required">
<dtbook:p>1. G.D.H. Cole in Horowitz, <dtbook:em>The Anarchists</dtbook:em> (New York: Dell Publishing, 1964).</dtbook:p>
</dtbook:note>
<dtbook:note id="fn_ch1_2">
<dtbook:note id="fn_ch1_2" class="footnote required">
<dtbook:p>2. G. Woodcock, <dtbook:em>Anarchism</dtbook:em> (Harmondsworth: Penguin, 1979), 8&#x2013;9.</dtbook:p>
<dtbook:pagenum page="normal" id="page-40">40</dtbook:pagenum>
</dtbook:note>
<dtbook:note id="fn_ch1_3">
<dtbook:note id="fn_ch1_3" class="footnote required">
<dtbook:p>3. <dtbook:em>Dictionnaire de L Acad&#x00E9;mie Fran&#x00E7;aise</dtbook:em> at http://colet.uhicago.edu/cgi-bin</dtbook:p>
</dtbook:note>
</dtbook:level1>
<dtbook:level1 id="rearmatter-notes">
<dtbook:h1>notes</dtbook:h1>
<dtbook:level2 class="footnotes">
<dtbook:h2>notes</dtbook:h2>
<dtbook:note id="fn_ch1_1">
<dtbook:note id="fn_ch1_1" class="footnote required">
<dtbook:p>1. G.D.H. Cole in Horowitz, <dtbook:em>The Anarchists</dtbook:em> (New York: Dell Publishing, 1964).</dtbook:p>
</dtbook:note>
<dtbook:note id="fn_ch1_2">
<dtbook:note id="fn_ch1_2" class="footnote required">
<dtbook:p>2. G. Woodcock, <dtbook:em>Anarchism</dtbook:em> (Harmondsworth: Penguin, 1979), 8&#x2013;9.</dtbook:p>
<dtbook:pagenum page="normal" id="page-40">40</dtbook:pagenum>
</dtbook:note>
<dtbook:note id="fn_ch1_3">
<dtbook:note id="fn_ch1_3" class="footnote required">
<dtbook:p>3. <dtbook:em>Dictionnaire de L Acad&#x00E9;mie Fran&#x00E7;aise</dtbook:em> at http://colet.uhicago.edu/cgi-bin</dtbook:p>
</dtbook:note>
<dtbook:div>
<dtbook:note id="fn_ch1_1">
<dtbook:note id="fn_ch1_1" class="">
<dtbook:p>1. G.D.H. Cole in Horowitz, <dtbook:em>The Anarchists</dtbook:em> (New York: Dell Publishing, 1964).</dtbook:p>
</dtbook:note>
</dtbook:div>
Expand Down Expand Up @@ -3096,14 +3096,14 @@
</html:ol>
</x:context>
<x:expect label="the text node and the span element should be wrapped in a p, while the p should not be wrapped in another p">
<dtbook:note id="rn1"><dtbook:p>1 Rearnote</dtbook:p></dtbook:note>
<dtbook:note id="rn2"><dtbook:p><dtbook:span>2 Rearnote</dtbook:span></dtbook:p></dtbook:note>
<dtbook:note id="rn3"><dtbook:p>3 Rearnote</dtbook:p></dtbook:note>
<dtbook:note id="rn4">
<dtbook:note id="rn1" class="rearnote required"><dtbook:p>1 Rearnote</dtbook:p></dtbook:note>
<dtbook:note id="rn2" class="rearnote required"><dtbook:p><dtbook:span>2 Rearnote</dtbook:span></dtbook:p></dtbook:note>
<dtbook:note id="rn3" class="rearnote required"><dtbook:p>3 Rearnote</dtbook:p></dtbook:note>
<dtbook:note id="rn4" class="rearnote required">
<!-- comment -->
<dtbook:p>4 Rearnote</dtbook:p>
</dtbook:note>
<dtbook:note id="fn_102">
<dtbook:note id="fn_102" class="footnote required">
<dtbook:p>
<dtbook:span id="dtb1121">Henri 1987</dtbook:span>
</dtbook:p>
Expand All @@ -3118,7 +3118,7 @@
</html:ol>
</x:context>
<x:expect label="there should be no wrapping &lt;list&gt; element">
<dtbook:note id="n13-1"><dtbook:p>...</dtbook:p></dtbook:note>
<dtbook:note id="n13-1" class="footnote required"><dtbook:p>...</dtbook:p></dtbook:note>
</x:expect>
</x:scenario>

Expand Down Expand Up @@ -3219,7 +3219,7 @@
</html:ol>
</x:context>
<x:expect label="the nested lists should adjust their depths as the nesting list item becomes a note">
<dtbook:note id="n13-1">
<dtbook:note id="n13-1" class="footnote required">
<dtbook:list depth="1" type="pl">
<dtbook:li>
<dtbook:p>original depth: 2, new depth: 1</dtbook:p>
Expand Down

0 comments on commit 44bc40b

Please sign in to comment.