Skip to content

Commit

Permalink
Latest changes in schema and transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Jan 21, 2020
1 parent 682d849 commit 033ad12
Showing 6 changed files with 61 additions and 32 deletions.
1 change: 1 addition & 0 deletions xxe/eoa/eoa.incl
Original file line number Diff line number Diff line change
@@ -108,6 +108,7 @@
<parameter name="frontmatter">true</parameter>
<parameter name="frontmattermanual">false</parameter>
<parameter name="contributors">false</parameter>
<parameter name="contributorsmanual">false</parameter>
<parameter name="manualpreambel">true</parameter>
<parameter name="extranewpage">false</parameter>
<parameter name="indentfloats">false</parameter>
2 changes: 1 addition & 1 deletion xxe/eoa/rnc/eoa-tei-strict.rnc
Original file line number Diff line number Diff line change
@@ -458,7 +458,7 @@ figure =
# attribute n { xsd:integer }?)|
# attribute n { "nonumber" } ),
attribute n { xsd:integer | "nonumber" }?,
attribute place { "t" | "ht" | "!ht" | "H" }?,
attribute place { "b" | "hb" | "!hb" |"t" | "ht" | "!ht" | "H" }?,
attribute xml:id { xsd:NCName }?,
attribute rend { "landscape" }?,
attribute type { xsd:NCName }?,
27 changes: 22 additions & 5 deletions xxe/eoa/xsl/tei2eoatex.xsl
Original file line number Diff line number Diff line change
@@ -8,7 +8,9 @@
version="2.0">

<xsl:param name="frontmatter" as="xs:boolean" required="no" select="false()"/>
<xsl:param name="frontmattermanual" as="xs:boolean" required="no" select="false()"/>
<xsl:param name="contributors" as="xs:boolean" required="no" select="false()"/>
<xsl:param name="contributorsmanual" as="xs:boolean" required="no" select="false()"/>
<xsl:param name="strictfloats" as="xs:boolean" required="no" select="false()"/>
<xsl:param name="indentfloats" as="xs:boolean" required="no" select="false()"/>
<xsl:param name="extranewpage" as="xs:boolean" required="no" select="false()"/>
@@ -24,7 +26,7 @@
<xsl:include href="tei2eoatex/eoatex_textparts.xsl"/>

<xsl:variable name="langid" select="//tei:langUsage/tei:language/@ident"/>
<xsl:variable name="transl" select="document('data/aux/translations.xml')"/>
<xsl:variable name="transl" select="document('../../data/aux/translations.xml')"/>
<xsl:key name="en" match="translations/entry" use="@en"/>
<xsl:key name="de" match="translations/entry" use="@de"/>
<xsl:key name="fr" match="translations/entry" use="@fr"/>
@@ -102,8 +104,15 @@ contexts, a double replacement is performed.

<xsl:choose>
<xsl:when test="$frontmatter">
<xsl:text>\input{texfiles/frontmatter.tex}&#x000a;</xsl:text>
<xsl:call-template name="writefrontmatter"/>
<xsl:choose>
<xsl:when test="$frontmattermanual">
<xsl:text>\input{texfiles/frontmatter-manual.tex}&#x000a;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>\input{texfiles/frontmatter.tex}&#x000a;</xsl:text>
<xsl:call-template name="writefrontmatter"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="eoa:debug(1, 'Not writing the frontmatter.', '')" />
@@ -120,8 +129,15 @@ contexts, a double replacement is performed.
<xsl:choose>
<xsl:when test="$contributors">
<xsl:text>&#x000a;\EOAchapternonumber{List of Contributors}{List of Contributors}&#x000a;</xsl:text>
<xsl:text>\input{texfiles/contributors.tex}&#x000a;&#x000a;</xsl:text>
<xsl:call-template name="writecontributors"/>
<xsl:choose>
<xsl:when test="$contributorsmanual">
<xsl:text>\input{texfiles/contributors-manual.tex}&#x000a;&#x000a;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>\input{texfiles/contributors.tex}&#x000a;&#x000a;</xsl:text>
<xsl:call-template name="writecontributors"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="eoa:debug(1, 'Not writing list of contributors.', '')" />
@@ -141,6 +157,7 @@ contexts, a double replacement is performed.
</xsl:choose>

<xsl:text>\end{document}&#x000a;</xsl:text>
<xsl:sequence select="eoa:debug(1, 'DONE!', '')"/>
</xsl:template>
<!-- <xsl:template match="/"> ends here -->

4 changes: 3 additions & 1 deletion xxe/eoa/xsl/tei2eoatex/eoatex_processinginstructions.xsl
Original file line number Diff line number Diff line change
@@ -8,10 +8,12 @@
version="2.0">

<xsl:template match="//processing-instruction()[name()='latex']">
<xsl:sequence select="eoa:debug(0, 'found processing instruction. type latex', '')"/>
<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="//processing-instruction()[name()='eoa']">
<xsl:template match="processing-instruction('eoa')">
<xsl:sequence select="eoa:debug(0, 'found processing instruction. type: eoa', '')"/>
<xsl:choose>
<xsl:when test="contains(., 'printbibliography')">
<xsl:choose>
52 changes: 31 additions & 21 deletions xxe/eoa/xsl/tei2eoatex/eoatex_textparts.xsl
Original file line number Diff line number Diff line change
@@ -15,17 +15,17 @@
<xsl:text>\noindent\EOAemph{Traduzione italiana a p.~\EOApageref{</xsl:text>
<xsl:value-of select="substring-after(@corresp, '#')"/>
<xsl:text>}.}</xsl:text>
<xsl:text>\vspace{2\baselineskip}</xsl:text>
<xsl:text>\vspace{2\baselineskip}&#x000a;&#x000a;</xsl:text>
</xsl:when>
<xsl:when test="self::tei:div[@type='chaptertranslation']">
<xsl:text>\vspace{-2\baselineskip}</xsl:text>
<xsl:text>\noindent\EOAemph{Versione originale latina a p.~\EOApageref{</xsl:text>
<xsl:value-of select="substring-after(@corresp, '#')"/>
<xsl:text>}.}</xsl:text>
<xsl:text>\vspace{2\baselineskip}</xsl:text>
<xsl:text>\vspace{2\baselineskip}&#x000a;&#x000a;</xsl:text>
</xsl:when>
</xsl:choose>
<xsl:apply-templates select="*[not(self::tei:head)]"/>
<xsl:apply-templates select="*[not(self::tei:head)] | processing-instruction()"/>
</xsl:template>

<xsl:template match="tei:div[@type = ('section', 'subsection', 'subsubsection')]">
@@ -65,7 +65,7 @@
</xsl:otherwise>
</xsl:choose>
<xsl:text>&#x000a;</xsl:text>
<xsl:apply-templates select="tei:*[not(self::tei:head)]"/>
<xsl:apply-templates select="tei:*[not(self::tei:head)] | processing-instruction()"/>
</xsl:template>

<xsl:template match="tei:body//tei:quote">
@@ -298,7 +298,7 @@

<!-- head -->

<xsl:template match="tei:div[@type = 'chapter']/tei:head">
<xsl:template match="tei:div[ @type = ('chapter', 'chapteroriginal', 'chaptertranslation')]/tei:head">
<xsl:value-of select="eoa:debug(0, 'chapter heading: ', .)"/>
<xsl:text>\EOAchapter</xsl:text>
<xsl:choose>
@@ -373,7 +373,14 @@
<xsl:call-template name="begin_paragraph"/>
<xsl:choose>
<xsl:when test="not(@type) or @type='hitrue'">
<xsl:text>\EOAfigure</xsl:text>
<xsl:choose>
<xsl:when test="@rend='landscape'">
<xsl:text>\EOAlsfigure</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>\EOAfigure</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@n='nonumber'">
<xsl:text>nonumber{</xsl:text>
@@ -407,27 +414,30 @@
<xsl:text>{</xsl:text>
<xsl:value-of select="@xml:id"/>
<xsl:text>}</xsl:text>
<!-- need size! -->
<xsl:text>{</xsl:text>
<xsl:value-of select="./tei:graphic/@scale"/>
<xsl:text>}{</xsl:text>
<xsl:choose>
<xsl:when test="@place">
<xsl:value-of select="@place"/>
</xsl:when>
<xsl:otherwise>
<xsl:when test="not(@rend='landscape')">
<xsl:text>{</xsl:text>
<xsl:value-of select="./tei:graphic/@scale"/>
<xsl:text>}{</xsl:text>
<xsl:choose>
<xsl:when test="$strictfloats">
<xsl:text>!ht</xsl:text>
<xsl:when test="@place">
<xsl:value-of select="@place"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>ht</xsl:text>
<xsl:choose>
<xsl:when test="$strictfloats">
<xsl:text>!ht</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>ht</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
<xsl:text>}</xsl:text>
</xsl:when>
</xsl:choose>
<xsl:text>}</xsl:text>
</xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@type='hionlysub'">
@@ -654,7 +664,7 @@
<xsl:choose>
<xsl:when test="./tei:citedRange[not(@*)]">
<xsl:text>[</xsl:text>
<xsl:apply-templates/>
<xsl:apply-templates select="./tei:citedRange/node()"/>
<xsl:text>]</xsl:text>
</xsl:when>
<xsl:otherwise>
7 changes: 3 additions & 4 deletions xxe/tei.xxe
Original file line number Diff line number Diff line change
@@ -26,21 +26,20 @@ xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration">
<class>com.xmlmind.xml.xinclude.XIncludeScheme</class>
</inclusionScheme>

<!--

<relaxng compactSyntax="true" encoding="UTF-8" location="../xxe/eoa/rnc/eoa-tei-strict.rnc" />
-->

<!-- <schematron location="../xxe/eoa/schematron/eoa-tei-schematron.xml" /> -->
<!--
<relaxng compactSyntax="true" encoding="UTF-8" location="../xxe/eoa/rnc/eoa-tei-strict.rnc" />
<relaxng compactSyntax="false" encoding="UTF-8" location="../xxe/eoa/rng/1_simple.rng"/>
-->

<!--
<schema>
<location>http://www.tei-c.org/ns/1.0 ../xxe/eoa/xsd/EditionOpenAccess.xsd</location>
</schema>

-->
<command name="docxcmd">
<class>fr.unicaen.mrshcertic.xml.xxe.docx.DocxConvertCommand</class>
</command>

0 comments on commit 033ad12

Please sign in to comment.