: preprocessing function which converts each text() into a xml-node "textNode". This function is a experimental fall back solution and not the main preprocessing routine!
:
: @param $nodes the nodes to be converted
: @return item()* representing the converted node
:
:
: @version 1.2 (2017-10-15)
: @status working
: @author Uwe Sikora
:)
declarefunctionpre:preprocessing-textNode
($nodesasnode()*)asitem()*{
for$nodein$nodes
return
typeswitch($node)
...
...
@@ -44,7 +44,7 @@ declare function pre:preprocessing-textNode
}
)
)
caseelement(TEI)return(
element{$node/name()}{
$node/@*,
...
...
@@ -54,7 +54,7 @@ declare function pre:preprocessing-textNode
}
}
)
caseelement(lem)return(
element{$node/name()}{
$node/@*,
...
...
@@ -62,7 +62,7 @@ declare function pre:preprocessing-textNode
pre:preprocessing-textNode($node/node())
}
)
caseelement(rdg)return(
element{$node/name()}{
$node/@*,
...
...
@@ -70,7 +70,7 @@ declare function pre:preprocessing-textNode
pre:preprocessing-textNode($node/node())
}
)
caseelement(note)return(
if($node[@typeeq"editorial"])then(
)else(
...
...
@@ -80,8 +80,8 @@ declare function pre:preprocessing-textNode
}
)
)
defaultreturn(
defaultreturn(
element{$node/name()}{
$node/@*,
pre:preprocessing-textNode($node/node())
...
...
@@ -90,7 +90,7 @@ declare function pre:preprocessing-textNode
};
(:~
(:~
: pre:pre:default-element
: function that suites as default element constructor for the preproseccing conversion.
: It is more or less a copy function, copying the elements name and its node and recurively leeds the conversion to its child-nodes
...
...
@@ -98,7 +98,7 @@ declare function pre:preprocessing-textNode
: @param $node the node to be copied
: @param $recursive-function the recursive function as some kind of call back to the main conversion
: @return item()* representing the converted node
:
:
: @version 1.0 (2018-01-31)
: @note Would be great if $recursive-function would be a real function and not a node-sequence (TO-DO)
: @status working
...
...
@@ -106,39 +106,49 @@ declare function pre:preprocessing-textNode