From ihe.onwuka at gmail.com Sun May 24 06:14:31 2020 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sun, 24 May 2020 09:14:31 -0400 Subject: [xquery-talk] Wrap element constructor and output disappears Message-ID: Also posted on SO https://stackoverflow.com/questions/61986249/cannot-wrap-element-around-xquery-output but happy to get an answer anywher. Returning to XQuery after a long hiatus. let $root := for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] return namespace-uri-for-prefix($prefix,$root) ! gives the expected But if I try to wrap an element around that output like below nothing is returned { let $root := for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] return namespace-uri-for-prefix($prefix,$root) ! } So what is wrong and how do I wrap the output in a parameters element? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihe.onwuka at gmail.com Sun May 24 08:00:44 2020 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sun, 24 May 2020 11:00:44 -0400 Subject: [xquery-talk] Wrap element constructor and output disappears In-Reply-To: References: Message-ID: Tagging this to the eXist-db mailing list as someone reports the code works for them. On Sun, May 24, 2020 at 9:14 AM Ihe Onwuka wrote: > Also posted on SO > https://stackoverflow.com/questions/61986249/cannot-wrap-element-around-xquery-output but > happy to get an answer anywher. > > Returning to XQuery after a long hiatus. > > let $root := > for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] > return > namespace-uri-for-prefix($prefix,$root) ! > > > gives the expected > > > > > But if I try to wrap an element around that output like below nothing is > returned > > { > let $root := > for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] > return > namespace-uri-for-prefix($prefix,$root) ! > > } > > So what is wrong and how do I wrap the output in a parameters element? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihe.onwuka at gmail.com Sun May 24 08:44:25 2020 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sun, 24 May 2020 11:44:25 -0400 Subject: [xquery-talk] Wrap element constructor and output disappears In-Reply-To: References: Message-ID: Apparently works in MarkLogic but not in eXist-db On Sun, May 24, 2020 at 11:05 AM Ihe Onwuka wrote: > This seems to be an eXist-db problem as someone on SO reports the code > works for them. > > The surrounding element constructor is causing the code to not return > anything at all. > > > > { > let $root := > for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] > return > namespace-uri-for-prefix($prefix,$root) ! > > } > > ---------- Forwarded message --------- > From: Ihe Onwuka > Date: Sun, May 24, 2020 at 9:14 AM > Subject: Wrap element constructor and output disappears > To: > > > Also posted on SO > https://stackoverflow.com/questions/61986249/cannot-wrap-element-around-xquery-output but > happy to get an answer anywher. > > Returning to XQuery after a long hiatus. > > let $root := > for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] > return > namespace-uri-for-prefix($prefix,$root) ! > > > gives the expected > > > > > But if I try to wrap an element around that output like below nothing is > returned > > { > let $root := > for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] > return > namespace-uri-for-prefix($prefix,$root) ! > > } > > So what is wrong and how do I wrap the output in a parameters element? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihe.onwuka at gmail.com Sun May 24 08:55:46 2020 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sun, 24 May 2020 11:55:46 -0400 Subject: [xquery-talk] Wrap element constructor and output disappears In-Reply-To: References: Message-ID: current state of play https://stackoverflow.com/a/61987989/1461707 On Sun, May 24, 2020 at 11:44 AM Ihe Onwuka wrote: > Apparently works in MarkLogic but not in eXist-db > > On Sun, May 24, 2020 at 11:05 AM Ihe Onwuka wrote: > >> This seems to be an eXist-db problem as someone on SO reports the code >> works for them. >> >> The surrounding element constructor is causing the code to not return >> anything at all. >> >> >> >> { >> let $root := >> for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] >> return >> namespace-uri-for-prefix($prefix,$root) ! >> >> } >> >> ---------- Forwarded message --------- >> From: Ihe Onwuka >> Date: Sun, May 24, 2020 at 9:14 AM >> Subject: Wrap element constructor and output disappears >> To: >> >> >> Also posted on SO >> https://stackoverflow.com/questions/61986249/cannot-wrap-element-around-xquery-output but >> happy to get an answer anywher. >> >> Returning to XQuery after a long hiatus. >> >> let $root := >> for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] >> return >> namespace-uri-for-prefix($prefix,$root) ! >> >> >> gives the expected >> >> >> >> >> But if I try to wrap an element around that output like below nothing is >> returned >> >> { >> let $root := >> for $prefix in in-scope-prefixes($root)[not(. = ('xml', 'xsi'))] >> return >> namespace-uri-for-prefix($prefix,$root) ! >> >> } >> >> So what is wrong and how do I wrap the output in a parameters element? >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: