Commit 13cb81c6 authored by thorsten.vitt's avatar thorsten.vitt
Browse files

Fixed item generation for work-level TEI documents.

parent e2d440c1
......@@ -3,6 +3,7 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tg="http://www.textgrid.de"
xmlns="http://textgrid.info/namespaces/metadata/core/2010" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:tei="http://www.tei-c.org/ns/1.0"
xpath-default-namespace="http://www.tei-c.org/ns/1.0"
xmlns:tns="http://textgrid.info/namespaces/metadata/core/2010"
xmlns:a="http://www.textgrid.info/namespace/digibib/authors"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
......@@ -17,6 +18,7 @@
<xd:doc>
<xd:desc>
<xd:p>This is only called for non-work TEI elements.</xd:p>
<xd:p>Test if an TEI-Element contains graphics or not.</xd:p>
<xd:p>If it contains graphics aggregate is as aggregation and generate not only the
corresponding item but also the corresponding aggregation.</xd:p>
......@@ -57,21 +59,25 @@
</xsl:choose>
</xsl:template>
<xd:doc>
<xd:desc>
<xd:p>This is only called for work TEI elements.</xd:p>
<xd:p>Generates an edition that aggregates the corresponding item and, if there are any graphics, the graphics.</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="generate-ed-aggregation-elements">
<xsl:param name="header" tunnel="yes"/>
<xsl:param name="path"/>
<xsl:param name="rel-path"/>
<ore:aggregates>
<xsl:attribute name="rdf:resource" select="concat($rel-path, '.edition')"/>
</ore:aggregates>
<ore:aggregates rdf:resource="{concat($rel-path, '.edition')}"/>
<xsl:choose>
<!-- Aggregate the current TEI-Element as aggregation if it contains graphics, generate the corresponding aggregation and aggregation
meta-files -->
<xsl:when test=".//tei:graphic">
<xsl:call-template name="generate-edition-meta">
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
<!-- Generate an aggregation for the current TEI-Element that aggregates the current-TEI-item and the graphic files -->
<xsl:call-template name="generate-edition">
<xsl:with-param name="aggr">
......@@ -89,9 +95,8 @@
</xsl:call-template>
<xsl:call-template name="generate-edition">
<xsl:with-param name="aggr">
<ore:aggregates>
<xsl:attribute name="rdf:resource" select="concat($rel-path, '.edition')"/>
</ore:aggregates>
<ore:aggregates rdf:resource="{concat($rel-path, '.edition')}"/>
<ore:aggregates rdf:resource="{concat($rel-path, '.item.xml')}"/>
</xsl:with-param>
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
......
......@@ -45,19 +45,33 @@
</object>
</xsl:result-document>
</xsl:template>
<!-- ***************Edition und Aggregation -->
<xd:doc>
<xd:desc>
<xd:p>Generates an edition. This creates the edition file (result document) ,
in there an entry for the item (if we are a TEI file) and entries for the
referenced graphics.</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="generate-edition">
<xsl:param name="path"/>
<xsl:param name="aggr"></xsl:param>
<xsl:result-document href="{concat($path, '.edition')}">
<rdf:RDF>
<rdf:Description>
<ore:aggregates rdf:resource="{concat(tg:rel-Path-of($path), '.item.xml')}"/>
<xsl:choose>
<xsl:when test="self::tei:TEI[.//graphic]">
<xsl:copy-of select="$aggr"/>
</xsl:when>
<xsl:when test="self::tei:TEI">
<ore:aggregates rdf:resource="{concat(tg:rel-Path-of($path), '.item.xml')}"/>
</xsl:when>
<xsl:otherwise>
<xsl:comment>
Also, diese Edition entspricht einem <xsl:value-of select="name(.)"/> mit der ID <xsl:value-of select="@xml:id"/>.
</xsl:comment>
<xsl:apply-templates select="tei:TEI|tei:teiCorpus" mode="#current"/>
</xsl:otherwise>
</xsl:choose>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment