Skip to content

Commit

Permalink
Populate header
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Aug 9, 2021
1 parent 128889c commit f119b33
Showing 1 changed file with 131 additions and 5 deletions.
136 changes: 131 additions & 5 deletions src/stylesheets/jats2tei.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,156 @@
<xsl:template
match="/"
>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<xsl:variable name="currentDateTime" as="xs:dateTime"
select="current-dateTime()"/>
<TEI change="metopes_publication#eoa" xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>
<title level="m" type="main">
<xsl:apply-templates select="//front/article-meta/title-group/article-title" />
</title>
<title level="m" type="sub">
<xsl:apply-templates select="//front/article-meta/title-group/subtitle" />
</title>
<!-- <xsl:apply-templates select="//front/article-meta/contrib-group"/> -->
<xsl:call-template name="ediaut"/>
<xsl:call-template name="respstmt"/>
</titleStmt>
<editionStmt>
<edition>First published <xsl:value-of select="year-from-dateTime($currentDateTime)"/></edition>
</editionStmt>
<extent>
<measure commodity="pages" quantity=""/>
<measure quantity="" type="price" unit="EUR"/>
</extent>

<publicationStmt>
<p>Publication Information</p>
<publisher>
<orgName n="EOA" ref="http://www.edition-open-access.de">Edition
Open Access</orgName>
<orgName n="Press" ref=""><choice>
<expan></expan>
<abbr></abbr>
</choice></orgName>
</publisher>
<idno type="isbn">978-3-945561-XXX</idno>
<idno type="shoplink">http://www.example-on-demand.de/shop/14971</idno>
<idno type="doi">DOI</idno>
<xsl:element name="date">
<xsl:attribute name="when">
<xsl:value-of select="format-dateTime($currentDateTime, '[Y]-[M01]-[D01]')"/>
</xsl:attribute>
</xsl:element>
<availability>
<licence
target="https://creativecommons.org/licenses/by-sa/4.0/">Creative
Commons Attribution-ShareAlike 4.0 International</licence>
</availability>
</publicationStmt>
<seriesStmt>
<title></title>
<idno type="number"></idno>
<respStmt>
<resp>Series Editors</resp>
<name type="serieseditors"></name>
</respStmt>
</seriesStmt>
<sourceDesc>
<p>Information about the source</p>
<p>Born digital.</p>
<ab type="suggestedcitation">contains suggested citation</ab>
<ab type="bibdatabase">
<ref target="" type=""/>
</ab>
</sourceDesc>
</fileDesc>
<profileDesc>
<abstract n="brief">
<p>Short abstract</p>
</abstract>
<abstract n="detailed">
<p>Long abstract.</p>
</abstract>
<abstract n="additional">
<p>This abstract contains additional information.</p>
</abstract>
<textClass>
<keywords>
<list>
<item>Example 1</item>
<item>Example 2</item>
</list>
</keywords>
</textClass>
<langUsage>
<language ident=""/>
</langUsage>
</profileDesc>
<encodingDesc>
<projectDesc>
</projectDesc>
<appInfo>
<application ident="TEI_from_JATS" version="1.0" xml:id="jatstotei">
<label>JATS to TEI</label>
</application>
</appInfo>
</encodingDesc>
<revisionDesc>
<xsl:element name="change">
<xsl:attribute name="when">
<xsl:value-of select="format-dateTime($currentDateTime, '[Y]-[M01]-[D01]')"/>
</xsl:attribute>
<xsl:attribute name="who">#jatstotei</xsl:attribute>
Conversion from JATS to TEI
</xsl:element>
</revisionDesc>
</teiHeader>
<text>
<text xml:id="text">
<front>
<xsl:comment>es</xsl:comment>
</front>
<body>
<xsl:apply-templates select="//body" />
</body>
</text>
</TEI>
</xsl:template>

<xsl:template name="ediaut">
<xsl:for-each select="//front/article-meta/contrib-group/contrib">
<xsl:element name="editor">
<xsl:attribute name="ref">
<xsl:value-of select="concat('#',@id)"/>
</xsl:attribute>
<xsl:value-of select="concat(name/given-names, ' ', name/surname)"/>
</xsl:element>
</xsl:for-each>
</xsl:template>

<xsl:template name="respstmt">
<xsl:for-each select="//front/article-meta/contrib-group/contrib">
<xsl:element name="respStmt">
<xsl:attribute name="xml:id">
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:element name="persName">
<xsl:if test="contrib-id">
<xsl:attribute name="ref">
<xsl:value-of select="contrib-id"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="name/surname">
<surname><xsl:value-of select="name/surname"/></surname>
</xsl:if>
<xsl:if test="name/given-names">
<forename><xsl:value-of select="name/given-names"/></forename>
</xsl:if>
<email><xsl:value-of select="email"/></email>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:template>

<xsl:template match="sec[@sec-type='chapter']">
<xsl:element name="div">
<xsl:attribute name="xml:id">
Expand Down

0 comments on commit f119b33

Please sign in to comment.