Commit 4bf0a33d authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

Merge branch 'bugfix/#139-error-index-seach' into 'develop'

Improve index look-up (closes #139)

Closes #139

See merge request !65
parents ff9c1004 132b9d49
...@@ -4,6 +4,7 @@ xquery version "3.1"; ...@@ -4,6 +4,7 @@ xquery version "3.1";
: given page. : given page.
: :
: @author Mathias Göbel : @author Mathias Göbel
: @author Michelle Weidling
: @version 1.1 : @version 1.1
: @since 2.5.6 : @since 2.5.6
: :) : :)
...@@ -17,6 +18,7 @@ declare namespace tgmd="http://textgrid.info/namespaces/metadata/core/2010"; ...@@ -17,6 +18,7 @@ declare namespace tgmd="http://textgrid.info/namespaces/metadata/core/2010";
declare namespace xhtml="http://www.w3.org/1999/xhtml"; declare namespace xhtml="http://www.w3.org/1999/xhtml";
import module namespace config="http://textgrid.de/ns/SADE/config" at "../config/config.xqm"; import module namespace config="http://textgrid.de/ns/SADE/config" at "../config/config.xqm";
import module namespace functx = "http://www.functx.com";
import module namespace ixp="http://fontane-nb.dariah.eu/index-processor" at "index-processor.xqm"; import module namespace ixp="http://fontane-nb.dariah.eu/index-processor" at "index-processor.xqm";
import module namespace rest="http://exquery.org/ns/restxq"; import module namespace rest="http://exquery.org/ns/restxq";
...@@ -221,7 +223,9 @@ declare ...@@ -221,7 +223,9 @@ declare
%test:assertTrue %test:assertTrue
function index:rendered-entity($id as xs:string) function index:rendered-entity($id as xs:string)
as item()* { as item()* {
let $node := $ixp:dataCollection/id($id) let $index-uris := ("253sx.xml", "253t0.xml", "253t1.xml", "253t2.xml", "253t3.xml")
let $indices := $ixp:dataCollection[functx:substring-after-last(base-uri(.), "/") = $index-uris]
let $node := $indices/id($id)
let $type := $node/root()//tei:body/*[1]/local-name() let $type := $node/root()//tei:body/*[1]/local-name()
(: listEvent, listPlace, listOrg, listPerson or list :) (: listEvent, listPlace, listOrg, listPerson or list :)
return return
......
Markdown is supported
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