Skip to content

Commit

Permalink
process mei:annot
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Nov 11, 2020
1 parent b054cfd commit ae9adc2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions catalogues/dictionary_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -604,4 +604,5 @@
<entry xml:id="internal">intern (WeGA)</entry>
<entry xml:id="external">extern</entry>
<entry xml:id="without">ohne</entry>
<entry xml:id="mei_notesStmt">Bemerkungen</entry>
</dictionary>
1 change: 1 addition & 0 deletions catalogues/dictionary_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -574,4 +574,5 @@
<entry xml:id="internal">internal (WeGA)</entry>
<entry xml:id="external">external</entry>
<entry xml:id="without">without</entry>
<entry xml:id="mei_notesStmt">Remarks</entry>
</dictionary>
7 changes: 6 additions & 1 deletion modules/app.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,11 @@ declare
config:get-xsl-params( map {'dbPath' : document-uri($model?doc), 'docID' : $model?docID })
),
'dedicatees' : $model?doc//mei:fileDesc/mei:titleStmt/mei:respStmt/mei:persName[@role='dte'],
'notesStmt': wega-util:transform(
$model?doc//mei:notesStmt,
doc(concat($config:xsl-collection-path, '/works.xsl')),
config:get-xsl-params( map {'dbPath' : document-uri($model?doc), 'docID' : $model?docID })
),
'backlinks' : core:getOrCreateColl('backlinks', $model('docID'), true()),
'gnd' : query:get-gnd($model('doc')),
'xml-download-url' : replace(app:createUrlForDoc($model('doc'), $model('lang')), '\.html', '.xml')
Expand Down Expand Up @@ -1858,7 +1863,7 @@ declare
%templates:wrap
%templates:default("max", "200")
function app:preview-teaser($node as node(), $model as map(*), $max as xs:string) as xs:string {
let $textXML := $model('doc')/tei:ab | $model('doc')//tei:body | $model('doc')//mei:annot[@type='Kurzbeschreibung']
let $textXML := $model('doc')/tei:ab | $model('doc')//tei:body | $model('doc')//mei:annot[@type='Kurzbeschreibung'] (: letzter Fall für sources :)
return
str:shorten-TEI($textXML, number($max), $model?lang)
};
Expand Down
4 changes: 4 additions & 0 deletions templates/work.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ <h3 data-template="lang:translate">dedicatees</h3>
<h3 data-template="lang:translate">creation</h3>
<div data-template="app-shared:output" data-template-key="creation"/>
</div>
<div data-template="app-shared:if-exists" data-template-key="notesStmt">
<h3 data-template="lang:translate">mei_notesStmt</h3>
<div data-template="app-shared:output" data-template-key="notesStmt"/>
</div>
<div data-template="app-shared:if-not-exists" data-template-key="dedicatees creation" data-template-or="false">
<!-- Wenn in der Werkdatei keine Detailinformationen (dedicatees, creation) gefunden werden, dann wird der folgende Standardtext ausgegeben -->
<p><i data-template="lang:translate">noWorkDetailsFound</i></p>
Expand Down
7 changes: 7 additions & 0 deletions xsl/works.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,11 @@
</xsl:element>
</xsl:template>

<xsl:template match="mei:annot">
<xsl:element name="p">
<xsl:apply-templates select="@xml:id"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>

</xsl:stylesheet>

0 comments on commit ae9adc2

Please sign in to comment.