From: Chris W. <kit...@gm...> - 2021-07-06 10:23:29
|
This works provided the steps are valid element names: declare function local:path-to-tree($path) { local:steps-to-tree(tokenize($path,"/")) }; declare function local:steps-to-tree($steps) { if (count($steps) = 0) then () else element {$steps[1]} { local:steps-to-tree(subsequence($steps,2)) } }; let $path := request:get-parameter("path",()) return local:path-to-tree($path) On Tue, Jul 6, 2021 at 10:26 AM Alfredo Cosco <alf...@gm...> wrote: > Hi all, > I'm working on eXist 4.7. > I have a string like this: > teiHeader/fileDesc/titleStmt/title > > Is there a way to transform it and store in a node like: > <teiHeader> > <fileDesc> > <titleStmt> > <title/> > <titleStmt> > </fileDesc> > </teiHeader> > > Thanks, > Alfredo > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > |