Skip to content

Commit

Permalink
Fix recursive template execution for child nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bpolitycki committed Dec 6, 2023
1 parent 3fae544 commit bf8cba3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions content/templates.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,18 @@ declare function templates:process($nodes as node()*, $model as map(*)) {
return
templates:call($instruction, $node, $model)
else
element { node-name($node) } {
$node/@*, for $child in $node/node() return templates:process($child, $model)
}
else $node
templates:process-childs($node, $model)
else templates:process-childs($node, $model)
default return
$node
};

declare %private function templates:process-childs($node as node(), $model as map(*)) {
element { node-name($node) } {
$node/@*, for $child in $node/node() return templates:process($child, $model)
}
};

declare %private function templates:get-instructions($class as xs:string?) as xs:string* {
for $name in tokenize($class, "\s+")
where templates:is-qname($name)
Expand Down

0 comments on commit bf8cba3

Please sign in to comment.