From: Jean-Paul R. <re...@gm...> - 2021-02-05 22:11:14
|
Dear Eduard, I use XSL in eXist all the time, but I don't think I've ever tried passing a collection via the transform:transform parameter - only a single document URL. I've since decided against passing them through a URL in the 3rd argument and instead write the XSL inside Xquery and inject the nodes directly into the XSL through a constructor - ie not a parameter argument in transform:transform. To state my process more clearly (I hope!), I use for-loop which calls transform:transform, and passing in the individual document from the collection each iteration of the loop into the XSL. I find it to be much faster than passing an eXist document URL to the parameter and then having Saxon go back into eXist to access the documents. Best, JPR On Fri, Feb 5, 2021 at 8:40 PM Joe Wicentowski <jo...@gm...> wrote: > Hi Eduard, > > I haven't used XSLT in eXist in ages, but I recall seeing questions about > that here on the mailing list and stackoverflow before. See Jean-Paul's > answer to a question, along with the link therein to the eXist > documentation: > > > https://stackoverflow.com/questions/62023540/document-uri-not-working-in-xslt-when-transform-is-called-from-exist-db > > I hope this helps. > > Joe > > On Fri, Feb 5, 2021 at 2:20 PM Eduard Drenth <ed...@fr...> > wrote: > >> Hi Joe, >> >> java -Xmx4096m -cp ~/saxonica10/saxon-he-10.2.jar >> net.sf.saxon.Transform -xsl:online-dictionaries/jsonDictionary/teiToParallel.xslt >> -s:test.xml dir=/home/eduard/fhwb/data/ > fhwbparallel.txt 2> >> fhwbparallel.log >> >> I am using exist 5.2 with no chenges at all >> >> To me it looks like the collection url xmldb:exist:// cannot be >> handled.... >> >> Bye, Eduard >> >> -----Original Message----- >> *From*: Joe Wicentowski <jo...@gm... >> <Joe%20Wicentowski%20%3cj...@gm...%3e>> >> *To*: Eduard Drenth <ed...@fr... >> <Eduard%20Drenth%20%3ce...@fr...%3e>> >> *Cc*: exi...@li... <exi...@li... >> <%22e...@li...%22%20%3ce...@li...%3e> >> > >> *Subject*: Re: [Exist-open] transform: Resource ... is a collection >> *Date*: Thu, 04 Feb 2021 14:49:50 -0500 >> >> Hi Eduard, >> >> When you say the XSLT "works via the command line", which command is it >> that you use? >> >> For the XQuery call to transform:transform, which version of eXist are >> you using? And I assume you're using the stock version of Saxon included >> with eXist and haven't replaced it with your own - but if I'm wrong, please >> specify. >> >> Joe >> >> On Mon, Feb 1, 2021 at 5:38 AM Eduard Drenth <ed...@fr...> >> wrote: >> >> Dear all, >> >> I have I xslt that works fine from the command line, it processes files >> in a directory: >> >> < >> >> xsl:for-each >> >> select >> >> ="collection($dir)/*" >> >> > >> >> >> >> Now I want to call it from xquery like this: >> >> >> transform >> >> : >> >> stream-transform >> >> ((),$ >> >> teidictjson >> >> : >> >> parallelxslt >> >> , >> >> >> < >> >> parameters >> >> > >> >> >> < >> >> param >> >> name= >> >> "dir" >> >> value= >> >> "xmldb:exist:// >> >> {$ >> >> config >> >> : >> >> data-root >> >> } >> >> " >> >> /> >> >> >> >> </ >> >> parameters >> >> >) >> >> >> >> This however produces an error: >> >> >> Exception while transforming node: I/O error reported by XML parser processing null: Resource /db/apps/teidictjson/data is a collection >> >> >> Tried a lot of things, no luck yet. >> >> >> Any idea's? >> >> >> Greetings, Eduard >> >> >> -- >> >> >> Eduard Drenth, Software Architekt >> >> ed...@fr... >> >> Doelestrjitte 8 >> 8911 DX Ljouwert >> +31 58 234 30 47 >> +31 62 094 34 28 (privé) >> >> skype: eduarddrenth >> https://github.com/eduarddrenth >> frisian.eu >> gpg: https://pgp.surfnet.nl/pks/lookup?search=eduarddrenth >> >> >> Op freed bin ik thús/wurkje ik minder >> >> >> >> _______________________________________________ >> Exist-open mailing list >> Exi...@li... >> https://lists.sourceforge.net/lists/listinfo/exist-open >> >> -- >> >> Eduard Drenth, Software Architekt >> >> ed...@fr... >> >> Doelestrjitte 8 >> 8911 DX Ljouwert >> +31 58 234 30 47 >> +31 62 094 34 28 (privé) >> >> skype: eduarddrenth >> https://github.com/eduarddrenth >> frisian.eu >> gpg: https://pgp.surfnet.nl/pks/lookup?search=eduarddrenth >> >> >> Op freed bin ik thús/wurkje ik minder >> >> >> >> _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > |