From ihe.onwuka at gmail.com Thu Feb 11 06:27:09 2021 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Thu, 11 Feb 2021 09:27:09 -0500 Subject: [xquery-talk] fn:transform running with default call-template invocation - no result-documents created Message-ID: This transform test.xsl copies (for the purpose of a small test example) a directory of XML data by calling an identity transform for each recursively encountered XML file. However if I invoke it from XQuery with fn:transform like so xquery version "3.1"; fn:transform(map { 'stylesheet-node' : doc('test.xsl')})?output none of the result-documents are created. Is there something wrong with the invoking XQuery? I have never before tried this so it is my best attempt from reading the docs. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihe.onwuka at gmail.com Thu Feb 11 09:35:15 2021 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Thu, 11 Feb 2021 12:35:15 -0500 Subject: [xquery-talk] fn:transform running with default call-template invocation - no result-documents created In-Reply-To: References: Message-ID: Posted on SO. It happens on Saxon 10.3 btw. https://stackoverflow.com/questions/66159827/fntransform-running-with-default-call-template-invocation-no-result-documents On Thu, Feb 11, 2021 at 9:27 AM Ihe Onwuka wrote: > This transform test.xsl copies (for the purpose of a small test example) a > directory of XML data by calling an identity transform for each recursively > encountered XML file. > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xs="http://www.w3.org/2001/XMLSchema" > xmlns:fn="http://www.w3.org/2005/xpath-functions" > xmlns:map="http://www.w3.org/2005/xpath-functions/map" > version="3.0" exclude-result-prefixes="xsi fn xs map" expand-text="yes"> > > > > select="doc('identity.xsl')"/> > > select="collection('file:///mnt/c/home/oneD/data/translatable' || > '?select=*.xml;recurse=yes')"> > href="{replace(document-uri(),'/data/translatable/','/translated/')}"> > > > > > > > However if I invoke it from XQuery with fn:transform like so > > xquery version "3.1"; > fn:transform(map { 'stylesheet-node' : doc('test.xsl')})?output > > none of the result-documents are created. > > Is there something wrong with the invoking XQuery? I have never before > tried this so it is my best attempt from reading the docs. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihe.onwuka at gmail.com Thu Feb 11 11:23:07 2021 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Thu, 11 Feb 2021 14:23:07 -0500 Subject: [xquery-talk] fn:transform running with default call-template invocation - no result-documents created In-Reply-To: References: Message-ID: Interesting. fn:transform overrides the side effects in the invoked transform and returns them as a map of result documents. Mba Mba Mba Mba (that's for Uche). Not what I wanted or would expect. On Thu, Feb 11, 2021 at 12:35 PM Ihe Onwuka wrote: > Posted on SO. It happens on Saxon 10.3 btw. > > > https://stackoverflow.com/questions/66159827/fntransform-running-with-default-call-template-invocation-no-result-documents > > On Thu, Feb 11, 2021 at 9:27 AM Ihe Onwuka wrote: > >> This transform test.xsl copies (for the purpose of a small test example) >> a directory of XML data by calling an identity transform for each >> recursively encountered XML file. >> >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xmlns:xs="http://www.w3.org/2001/XMLSchema" >> xmlns:fn="http://www.w3.org/2005/xpath-functions" >> xmlns:map="http://www.w3.org/2005/xpath-functions/map" >> version="3.0" exclude-result-prefixes="xsi fn xs map" expand-text="yes"> >> >> >> >> > select="doc('identity.xsl')"/> >> >> > select="collection('file:///mnt/c/home/oneD/data/translatable' || >> '?select=*.xml;recurse=yes')"> >> > href="{replace(document-uri(),'/data/translatable/','/translated/')}"> >> >> >> >> >> >> >> However if I invoke it from XQuery with fn:transform like so >> >> xquery version "3.1"; >> fn:transform(map { 'stylesheet-node' : doc('test.xsl')})?output >> >> none of the result-documents are created. >> >> Is there something wrong with the invoking XQuery? I have never before >> tried this so it is my best attempt from reading the docs. >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihe.onwuka at gmail.com Thu Feb 11 12:12:47 2021 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Thu, 11 Feb 2021 15:12:47 -0500 Subject: [xquery-talk] fn:transform running with default call-template invocation - no result-documents created In-Reply-To: <256ceee4dc93f157176e68378bbd19b4d6938421.camel@fromoldbooks.org> References: <256ceee4dc93f157176e68378bbd19b4d6938421.camel@fromoldbooks.org> Message-ID: Yes I see this is what it was designed to do....I could also serialize this out by specifying a post-process function. Too much extra palava - it was only meant to be an XQuery wrapper around an already working transformation. On Thu, Feb 11, 2021 at 2:49 PM Liam R. E. Quin wrote: > On Thu, 2021-02-11 at 09:27 -0500, Ihe Onwuka wrote: > > > > However if I invoke it from XQuery with fn:transform like so > > > > xquery version "3.1"; > > fn:transform(map { 'stylesheet-node' : doc('test.xsl')})?output > > > > none of the result-documents are created. > > You need to go on my XSLT course :-) > > What happens is the content that would have been written out via > result-document ends up in the result map, with the keys being the URIs > to which they would have been written. > > So, save the result of fn:transform() and use map:keys() or map:each() > to find them and use e.g. file:write() or fn:put() or database:store- > somewhere() as appropriate. > > Liam > > > -- > Liam Quin, https://www.delightfulcomputing.com/ > Available for XML/Document/Information Architecture/XSLT/ > XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. > Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.gruen at gmail.com Thu Feb 25 04:02:43 2021 From: christian.gruen at gmail.com (=?UTF-8?Q?Christian_Gr=C3=BCn?=) Date: Thu, 25 Feb 2021 13:02:43 +0100 Subject: [xquery-talk] [ANN] BaseX 9.5: The Spring Edition In-Reply-To: References: Message-ID: Dear all, We are more than happy to provide you with a new and fresh version of BaseX, our XML framework, database system and XQuery 3.1 processor: https://basex.org/ BaseX is getting faster and faster! We have spent most of our time on query rewritings and optimizations, which will speed up the execution of your XQuery code and RESTXQ apps. You can find various other new enhancements in our release: RESTXQ - the client IP address behind a proxy is added to the logs - stack traces in the error message can now be suppressed - the default error code has been changed from 400 to 500 - error messages are more user-friendly now (#1708) - content negotiation was improved (#1991) - inline arguments of called function (#1982) XQUERY FUNCTIONS - Utility: new functions for sequences, arrays and maps - Higher-Order Functions: hof:drop-while - Jobs: More options for job intervals XQUERY PERFORMANCE - revised scoring propagation (all items will take less memory) - default function inlining limit reduced from 100 to 50 - axis path rewritings, better typing (#1910, #1976, #1979) - better typing (#1906, #1908, #1909, #1944, #1945) - faster data()/string() checks (#1975) - rewrite map:merge to map:put (#1969) - rewrite order by to fn:sort (#1966) - rewrite group by to fn:distinct-values (#1932) - rewrite quantifiers to FLWOR expressions (#1961) - optimizations of arithmetic expressions (#1938, #1972) - optimizations of lookup operator (#1929, #1984) - optimizations of counts (#1965, #1973, #1974) - optimizations of regular lists (#1919, #1924) - optimizations of switch expression (#1920) - optimizations of instance of (#1939) - distinct values (#1930, #1967) - positional checks (#1937) - existence checks (#1971) For a more comprehensive list of added and updated features, check out our documentation (docs.basex.org) and check out the GitHub issues (github.com/BaseXdb/basex/issues). Have fun, Your BaseX Team