Commit 25ea9229 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

formatting function header

parent 0e5f35e9
......@@ -24,7 +24,8 @@ declare variable $f-register:getNotebook := $f-register:targetStart || request:g
: @param – $uri the textgrid-URI without prefix
: TODO: may this function should be placed in a generic module
: :)
declare function local:resolve-name($uri as xs:string) {
declare function local:resolve-name($uri as xs:string)
as xs:string {
let $title := string(doc($f-register:metaCollection || $uri || '.xml')//tgmd:title) => replace("0(\d)", "$1")
return
if($title = "") then $uri else $title
......@@ -44,7 +45,8 @@ as xs:boolean {
: checks if a target entity is in the current node set
: @param $node – any node set
: :)
declare function local:check-entity($node as node()+) as xs:string? {
declare function local:check-entity($node as node()+)
as xs:string? {
if(local:check-active($f-register:getEntity, $node))
then "active"
else ()
......@@ -54,7 +56,7 @@ declare function local:check-entity($node as node()+) as xs:string? {
: creates a generic xhtml:class attribute mandatory for every entry
: :)
declare function local:entry-class($id as xs:string?)
as attribute(class)?{
as attribute(class)? {
attribute class {
"registerEintrag",
if($id = $f-register:getEntity)
......@@ -224,7 +226,8 @@ as element(xhtml:li){
: code.
:
: :)
declare function f-register:register() as element(xhtml:div){
declare function f-register:register()
as element(xhtml:div) {
let $agg := '253st.xml' (: TextGrid Aggregation containing all index files :)
let $uris := doc('/db/sade-projects/textgrid/data/xml/agg/'||$agg)//ore:aggregates/substring-after(@rdf:resource, 'textgrid:')
let $meta := for $uri in $uris
......@@ -394,7 +397,8 @@ return
(:~
: parser for tei:listOrg
: :)
declare function f-register:orgs($orgDoc as element(tei:listOrg)+) as element(xhtml:div) {
declare function f-register:orgs($orgDoc as element(tei:listOrg)+)
as element(xhtml:div) {
let $orgURI := tokenize($orgDoc/base-uri(), '/|\.')[8]
return
(: Koerperschaftenregister :)
......@@ -427,7 +431,8 @@ else $orgList/tei:org
: transforms a single tei:org element to a xhtml:li
: @since 1.0
: :)
declare function local:prepare-org($org as element(tei:org)) as element(xhtml:li) {
declare function local:prepare-org($org as element(tei:org))
as element(xhtml:li) {
let $id := $org/@xml:id
let $labelMain := ($org/tei:orgName)[1]
let $labelAlt := ($org/(tei:orgName[not(@type="variant")], tei:idno))[position() gt 1]
......@@ -498,7 +503,8 @@ return
(:~
: parser for tei:listPerson
: :)
declare function f-register:persons($persDoc as element(tei:listPerson)) {
declare function f-register:persons($persDoc as element(tei:listPerson))
as element(xhtml:div) {
let $persURI := tokenize($persDoc/base-uri(), '/|\.')[8]
return
(: Personenregister :)
......@@ -528,7 +534,8 @@ else $persList/tei:*
</div>
};
declare function local:prepare-person($pers as element(*)+) as element(xhtml:li) {
declare function local:prepare-person($pers as element(*)+)
as element(xhtml:li) {
(: check if the item points to another entity :)
if( not(exists($pers/@xml:id)) )
then
......@@ -637,7 +644,8 @@ else
(:~
: prepares the index of geographical references
: :)
declare function f-register:places($listPlace as element(tei:listPlace)) {
declare function f-register:places($listPlace as element(tei:listPlace))
as element(xhtml:div) {
let $geoURI := tokenize($listPlace/base-uri(), '/|\.')[8]
return
<div id="r{ $geoURI }" class="tab-pane {local:check-entity($listPlace)}">
......@@ -665,7 +673,8 @@ else $listPlace/tei:place
(:~
: transformation of a single geographical reference item :)
declare function local:prepare-place($place as element(tei:place)) as element(xhtml:ul) {
declare function local:prepare-place($place as element(tei:place))
as element(xhtml:ul) {
(: check if the item points to another entity :)
if( not(exists($place/@xml:id)) )
then
......@@ -752,7 +761,8 @@ else
(:~
: prepares the list of works :)
declare function f-register:works($wrkDoc) {
declare function f-register:works($wrkDoc)
as element(xhtml:div) {
let $wrkURI := tokenize($wrkDoc/base-uri(), '/|\.')[8]
return
<div id="r{ $wrkURI }-{$wrkDoc/string(@type)}" class="tab-pane {local:check-entity($wrkDoc)}">
......@@ -790,7 +800,8 @@ else
(:~
: prepares a single work item :)
declare function local:prepare-work($work as element(tei:item)) as element(xhtml:li) {
declare function local:prepare-work($work as element(tei:item))
as element(xhtml:li) {
(: check if the item points to another entity :)
if( not(exists($work/@xml:id)) )
then
......
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