Re: [basex-talk] File permissions on .basex files
Thanks for the reply, Christian. I want to create the databases on Linux, and then multiple users need to access the database directory. The other users are generally on Windows. You're correct, I'm not using the client/server architecture. (I haven't looked into it. If you think it's what I really should be doing, I can start to look at it.) If it's a Linux thing, not specific to BaseX, then maybe that is good news for me. I'll see what I can find about default permissions on Linux. Cheers, Amanda -Original Message- From: Christian Grün [mailto:christian.gr...@gmail.com] Sent: Monday, August 03, 2015 10:58 AM To: Amanda Galtman amanda.galt...@mathworks.com Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] File permissions on .basex files Hi Amanda, In Java, we use default operations for creating files and directories. My knowledge on Linux file permissions is limited, but I just ran BaseX on two different Linux machines, and I noticed that different permissions were assigned to the newly created files on both systems. So.. Maybe there are some Linux experts on this list who can tell us if there are ways to define default permissions for newly created files for specific users, or all sub-directories in the BaseX directory? Alternatively or in addition, perhaps it is possible to stop requiring write permission for non-updating queries; I’m not familiar with the reason why write permission is needed. This is tricky indeed indeed. Databases are opened in the very core of BaseX, and they are not bound to specific users. A database will be opened once, but it may then accessed by different users in the client/server architecture. But I assume that the problems you describe are caused by multiple users accessing the same database directory on a Linux machine, and that you don't use the client/server architecture? Cheers, Christian
Re: [basex-talk] File permissions on .basex files
-Original Message- From: Christian Grün [mailto:christian.gr...@gmail.com] Sent: Monday, August 03, 2015 11:35 AM To: Amanda Galtman amanda.galt...@mathworks.com Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] File permissions on .basex files I want to create the databases on Linux, and then multiple users need to access the database directory. The other users are generally on Windows. You're correct, I'm not using the client/server architecture. (I haven't looked into it. If you think it's what I really should be doing, I can start to look at it.) The C/S architecture ensures that no one can update the data in parallel. If there will be no updates, your setup should be fine (apart from issues like the ones you encountered..). Thanks, that's really useful to know. In our system, there is only one user updating the databases, so I'll stick with the approach I have.
Re: [basex-talk] File permissions on .basex files
I want to create the databases on Linux, and then multiple users need to access the database directory. The other users are generally on Windows. You're correct, I'm not using the client/server architecture. (I haven't looked into it. If you think it's what I really should be doing, I can start to look at it.) The C/S architecture ensures that no one can update the data in parallel. If there will be no updates, your setup should be fine (apart from issues like the ones you encountered..).
Re: [basex-talk] Round tripping JSON
Hi Marc, declare %rest:POST({$body}) %rest:path(/json) %rest:consumes(application/json;lax=yes;format=map) %rest:produces(application/json;format=map) If I remember right, content-type parameters in rest annotations will be ignored, because these annotations only serve as filters. Instead, you will need to specify the content-type parameters client-side (in your POST or PUT request). Hope this helps, Christian
Re: [basex-talk] Round tripping JSON
Hi Christian, No luck. I'm using Postman. I already had Content-Type = application/json and Accept = application/json. I tried changing it to application/json;format=map (btw do you think it's necessary to have the basex/restxq specific pseudo attributes (format= etc) in the HTTP request headers?) I'm seeing 400 errors like this: [bxerr:BASX0003] Input could not be converted: POST.xml (Line 1): No text allowed before root element. So something is different now but still there seems to be an expectation somewhere on the post being XML at least the filename suggests so. The documentation is a bit contradictory: The body of a POST or PUT request will be converted to an XQuery item. Conversion can be controlled by specifying a content type. It can be further influenced by specifying additional content-type parameters: The table below lists: application/jsonJSON Optionsdocument-node() On Mon, Aug 3, 2015 at 4:42 PM, Christian Grün christian.gr...@gmail.com wrote: Hi Marc, declare %rest:POST({$body}) %rest:path(/json) %rest:consumes(application/json;lax=yes;format=map) %rest:produces(application/json;format=map) If I remember right, content-type parameters in rest annotations will be ignored, because these annotations only serve as filters. Instead, you will need to specify the content-type parameters client-side (in your POST or PUT request). Hope this helps, Christian -- --Marc
Re: [basex-talk] Destination of result-document from XSLT module
Thank Vincent, But it the input of the xslt I want to control. I'm using BaseX with the CHOP false because I use text documentation and space is important at the end or the begining of an element, and when I try to use xslt (with baseX 7) it serialize with indent true the input of my xslt, so I lost the space. Marc Le 03/08/2015 23:07, Lizzi, Vincent a écrit : Thanks, Max and Andy. The XQuery 3.1 transform function looks promising. Marc, For controlling the serialization of XSLT output, you can specify serialization for the XSLT within the XSLT itself using xsl:output, run the XSLT using the xslt:transform-text, and then write the output to a file. file:write-text('file.txt', xslt:transform-text($doc, $xslt)) I'm not sure if this will do what you need, but so far it has been working for me. Vincent -Original Message- From: basex-talk-boun...@mailman.uni-konstanz.de [mailto:basex-talk-boun...@mailman.uni-konstanz.de] On Behalf Of Marc Sent: Monday, August 03, 2015 4:53 PM Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] Destination of result-document from XSLT module Hi, I have an other problem is to control the serialization of the node passed to the transform function. I don't see how to control it. Marc Le 03/08/2015 22:32, Andy Bunce a écrit : Hi Max, This sounds like a good thing. Another solution to the result-document issue might be to implement the XQuery 3.1 transform function [1] /Andy [1] http://www.w3.org/TR/xpath-functions-31/#func-transform On 3 August 2015 at 20:54, Max Goltzsche max.goltzs...@algorythm.de mailto:max.goltzs...@algorythm.de wrote: Hello Vincent, besides an URI resolver I also want to set XSLT 2.0's output destination in BaseX. Currently as you can see in BaseX' xslt:transform and xslt:transform-text implementation in https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/query/func/xslt/XsltTransform.java there is neither an URIResolver or OutputURIResolver set on the Transformer nor a destination systemId set on its StreamResult. Thus Saxon resolves output paths relative to your Java process' working directory (in fact all relative XSL include, import, document and collection paths in the XSLT passed to the transform method). Unfortunately to change this behaviour the XsltTransform class must be enhanced. If you need a quicker* solution for your problem you may have to build your own BaseX transform Java Module based on the XsltTransform class setting at least the StreamResult's systemId I think. I will be also working on this the next evenings. best regards, Max On 03.08.2015 20:54, Lizzi, Vincent wrote: I’m trying to use the XSLT Module in BaseX 8.2.3 with Saxon 9.6 to run an XSLT that produces several output documents using xsl:result-document. I’m having trouble setting the location of the output documents. I want to have xsl:result-document create the output documents in a temporary folder because the documents need to be zipped together. __ __ According to Saxon’s documentation, the a relative path in the href attribute of xsl:result-document will be resolved using either the path of the Destination, or the current directory. The XSLT Module does not appear have a way to provide a path for a destination document. What I’m seeing is that the result documents are created in BaseX’s home directory. The XSLT works as expected when run using Saxon from the command line, where it’s possible to set a destination path. __ __ Is there a way to specify a Base Output URI to the XSLT Module? Or, would it be possible to specify a file URI output location to a method like xslt:transform? __ __ One possible workaround is to provide an absolute path as a parameter to the XSLT, and use that parameter in the xsl:result-document href location. __ __ Here is a self-contained example code: __ __ __ __ declare function local:example($in, $xsl, $zipPath) { let $tempDir := file:create-temp-dir('test', 'example') let $x := xslt:transform-text($in, $xsl) return let $zip := archive:create-from($tempDir) return ( file:write-binary($zipPath, $zip) (: , file:delete($tempDir, true()) :) ) }; __ __ __ __ let $xsl := xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; http://www.w3.org/1999/XSL/Transform xmlns:xs=http://www.w3.org/2001/XMLSchema; http://www.w3.org/2001/XMLSchema version=2.0 xsl:template match=/ xsl:result-document href=doc1.xml testthis is a
Re: [basex-talk] BaseX Package and Jetty
Hi Florian, Sorry again for not providing you with an in-depth solution, but your code was not as self-contained as I was hoping, and it would take me some more time to find out why it was originally working in a previous version of BaseX. However, I checked your wrapper.xq file inside the archive, and I would recommend you to do the actual work in an extra Java function and limit the wrapper code to a single call of that function. Maybe this helps? Christian On Fri, Jul 31, 2015 at 11:49 AM, Eckey, Florian florian.ec...@adesso.de wrote: Hi Christian, Thanks for the hint. Here is a new link to the file: https://drive.google.com/file/d/0Bw303eobkYo6a2kxVUExVlFQZ3M/view?usp=sharing. Hope it works now. Here some further input: I want to integrate a vcard to xcard converter into basex. You can find some java code on github, which is doing that: https://github.com/mangstadt/ez-vcard. So what have done is create a xar archive, which contains the java code and a xquery file which wraps the java code. In version 7 of basex it works well if I declare the namespace and use it. But in version 8.2.1 I get some problems. Here is the code of xquery wrapper file: module namespace vcard=http://mycompany.de/util/vcards;; declare namespace ezv=java:ezvcard.Ezvcard; declare namespace pcts=java:ezvcard.Ezvcard$ParserChainTextString; (: THIS CANNOT BE FOUND :) declare namespace pcxs=java:ezvcard.Ezvcard$ParserChainXmlString; declare namespace wcx=java:ezvcard.Ezvcard$WriterChainXml; declare namespace xcd=java:ezvcard.io.xml.XCardDocument; declare namespace jvcard=java:ezvcard.VCard; declare namespace vcv=java:ezvcard.VCardVersion; declare namespace vc=urn:ietf:params:xml:ns:vcard-4.0; declare function vcard:vCards2xCards($vCards as xs:string) as element(vc:vcards) { parse-xml(jvcard:writeXml(pcts:first(ezv:parse($vCards/* }; The error is: java:ezvcard.Ezvcard$ParserChainTextString cannot be found. It seams that basex in the newer version cannot access inner java classes. Does anyone have an idea, why basex doesn't find it? Thanks and cheers Florian -Ursprüngliche Nachricht- Von: Christian Grün [mailto:christian.gr...@gmail.com] Gesendet: Donnerstag, 30. Juli 2015 10:00 An: Eckey, Florian florian.ec...@adesso.de Cc: basex-talk@mailman.uni-konstanz.de Betreff: Re: [basex-talk] BaseX Package and Jetty Hi Florian, Sorry for the late feedback. It seems I have no access to your file on Google Drive. Maybe you can provide us with a mini code example, which only contains the relevant files, and attach it to a mail to this list? Thanks in advance, Christian On Tue, Jul 28, 2015 at 4:25 PM, Eckey, Florian florian.ec...@adesso.de wrote: Hi guys, i have a problem with the basex package mechanism. I tried to install a self implemented xar file including java classes. In version 7 it works well, but in version 8.2.1 it doesn't. The xar can be found on: https://drive.google.com/open?id=0Bw303eobkYo6a2kxVUExVlFQZ3M. The java source code can be found on https://github.com/mangstadt/ez-vcard. With the newer basex version i get the error, that basex cannot find the inner java class ezvcard.Ezvcard$ParserChainTextString. Does anyone have an idea, why basex doesn't find it? A further question: Is it planned to integrate the newest jetty version 9+ into basex to use HTTP/2 ? If not, is there a way to integrate it on my own? Do I have to replace the jetty classes only? Thanks and regards Florian -- Florian Eckey adesso AG T +49 231 930-9330 Software Developement F +49 231 930-9331 Stockholmer Allee 24 E florian.ec...@adesso.de 44269 Dortmundwww.adesso.de - business. people. technology. - adesso AG mit Sitz in Dortmund Vorstand: Christoph Junge, Michael Kenfenheuer (Co-Vors.), Dr. Rüdiger Striemer (Co-Vors.) Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn Amtsgericht Dortmund HRB 20663 --- business. people. technology. --- adesso AG mit Sitz in Dortmund Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn Amtsgericht Dortmund HRB 20663 --- business. people. technology. --- adesso AG mit Sitz in Dortmund Vorstand: Michael Kenfenheuer (Vors.), Christoph Junge, Andreas Prenneis Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn Amtsgericht Dortmund HRB 20663
Re: [basex-talk] compiling and building basex-core with maven
Hi Jens, Ok that did the trick: I raised both constants 10-times and quit all activities except walking the dogs. Didn't get the error anymore and the build completed. Thnx, Rob PS. sound like nice: Lake Constance. -Oorspronkelijk bericht- Van: Jens Erat [mailto:jens.e...@uni-konstanz.de] Verzonden: zondag 2 augustus 2015 20:35 Aan: Christian Grün; Rob Stapper CC: BaseX Onderwerp: Re: [basex-talk] compiling and building basex-core with maven Hi Rob, this test verifies parallel execution. To be able to also have test whether queries that should _not_ run in parallel actually do not, tests time out after a given time -- with defaults that proved to be reasonable on all of our machines, but _might_ be a little bit to short on others. Increasing those timeouts will make the general execution of the test suite slower, so we tried to keep them small. To further investigate, would you please post back to the mailing list including: - Any relevant environment variables set, especially everything related to Java or Maven - Increase the `SLEEP` and `SYNC` constants in `basex-core/src/test/java/org/basex/server/LockingTest.java` (those are the timeouts in milliseconds), and rerun the test suite. Best regards from Lake Constance, Germany, Jens Am 02.08.2015 um 19:22 schrieb Christian Grün: Hi Rob, Thanks for letting us know. The tests are curently running fine on our Windows and Linux machines for testing and deployment, but I hope we can find out what's the problem in you environment. For now, simply delete the tests, or use -DskipTests to get BaseX installed without tests. Best, Christian On Sat, Aug 1, 2015 at 5:28 PM, Rob Stapper r.stap...@lijbrandt.nl wrote: Hi Christian, I’m trying to compile and build the basex-core. All is going quit well except that one testrun is failing which results in not being able to build the basex-core. I started the process from within the basex-core-directory with the command: mvn –U clean install. After a zillion test almost as last the “org.basex.server.LockingTest” fails with the message: java.lang.AssertionError: Parallel execution expected at org.junit.Assert.failAssert.java:88 at org.junit.Assert.assertTrueAssert.java:41 at org.junit.Assert.LockingTest.testQueriesLockingTest.java:125 at org.junit.Assert.LockingTest. LockingTest.LockingTest.java:146 I’m running on a simple windows-system with windows vista home edition. No apache-serve running. Can you give me a hint to get the basex-core build? TIA. Rob PS. maven on Basex-test also give problems but basex-api and basex-examples works fine. Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. www.avast.com -- Jens Erat [phone]: tel:+49-151-56961126 [mail]: mailto:em...@jenserat.de [jabber]: xmpp:jab...@jenserat.de [web]: http://www.jenserat.de OpenPGP: 0D69 E11F 12BD BA07 7B37 26AB 4E1F 799A A4FF 2279 --- Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware. https://www.avast.com/antivirus
Re: [basex-talk] Round tripping JSON
Wow, clicked send before I meant to. The last line was a copy from the table in the documentation and the last column has document-node() which seems to suggest that getting a map(*) there isn't possible. So not sure what is supposed to happen. Anyway I would think that correct behaviour would be, I think, to deliver a map(*) to the function instead of a document-node() in this case. Maybe something to forward to Adam Retter / RESTXQ? --Marc On Mon, Aug 3, 2015 at 4:54 PM, Marc van Grootel marc.van.groo...@gmail.com wrote: Hi Christian, No luck. I'm using Postman. I already had Content-Type = application/json and Accept = application/json. I tried changing it to application/json;format=map (btw do you think it's necessary to have the basex/restxq specific pseudo attributes (format= etc) in the HTTP request headers?) I'm seeing 400 errors like this: [bxerr:BASX0003] Input could not be converted: POST.xml (Line 1): No text allowed before root element. So something is different now but still there seems to be an expectation somewhere on the post being XML at least the filename suggests so. The documentation is a bit contradictory: The body of a POST or PUT request will be converted to an XQuery item. Conversion can be controlled by specifying a content type. It can be further influenced by specifying additional content-type parameters: The table below lists: application/jsonJSON Optionsdocument-node() On Mon, Aug 3, 2015 at 4:42 PM, Christian Grün christian.gr...@gmail.com wrote: Hi Marc, declare %rest:POST({$body}) %rest:path(/json) %rest:consumes(application/json;lax=yes;format=map) %rest:produces(application/json;format=map) If I remember right, content-type parameters in rest annotations will be ignored, because these annotations only serve as filters. Instead, you will need to specify the content-type parameters client-side (in your POST or PUT request). Hope this helps, Christian -- --Marc -- --Marc
Re: [basex-talk] File permissions on .basex files
Hi Amanda, In Java, we use default operations for creating files and directories. My knowledge on Linux file permissions is limited, but I just ran BaseX on two different Linux machines, and I noticed that different permissions were assigned to the newly created files on both systems. So.. Maybe there are some Linux experts on this list who can tell us if there are ways to define default permissions for newly created files for specific users, or all sub-directories in the BaseX directory? Alternatively or in addition, perhaps it is possible to stop requiring write permission for non-updating queries; I’m not familiar with the reason why write permission is needed. This is tricky indeed indeed. Databases are opened in the very core of BaseX, and they are not bound to specific users. A database will be opened once, but it may then accessed by different users in the client/server architecture. But I assume that the problems you describe are caused by multiple users accessing the same database directory on a Linux machine, and that you don't use the client/server architecture? Cheers, Christian
Re: [basex-talk] Round tripping JSON
Hi Marc, I'm using Postman. I already had Content-Type = application/json and Accept = application/json. I tried changing it to application/json;format=map I noticed that you get different result when specify 'format=basic' or 'format=direct': curl -XPUT -HContent-Type:application/json;format=basic -Tinput.json http://localhost:8984/test; ..so I guess something is going wrong here. I'll dive into this soon. (btw do you think it's necessary to have the basex/restxq specific pseudo attributes (format= etc) in the HTTP request headers?) You can also use %input:json(...) if you don't want to specify the format client-side. Maybe something to forward to Adam Retter / RESTXQ? So far, the content-type parameter extensions have not been adopted in RESTXQ yet, but feel free to give him an update! Christian
[basex-talk] Destination of result-document from XSLT module
I'm trying to use the XSLT Module in BaseX 8.2.3 with Saxon 9.6 to run an XSLT that produces several output documents using xsl:result-document. I'm having trouble setting the location of the output documents. I want to have xsl:result-document create the output documents in a temporary folder because the documents need to be zipped together. According to Saxon's documentation, the a relative path in the href attribute of xsl:result-document will be resolved using either the path of the Destination, or the current directory. The XSLT Module does not appear have a way to provide a path for a destination document. What I'm seeing is that the result documents are created in BaseX's home directory. The XSLT works as expected when run using Saxon from the command line, where it's possible to set a destination path. Is there a way to specify a Base Output URI to the XSLT Module? Or, would it be possible to specify a file URI output location to a method like xslt:transform? One possible workaround is to provide an absolute path as a parameter to the XSLT, and use that parameter in the xsl:result-document href location. Here is a self-contained example code: declare function local:example($in, $xsl, $zipPath) { let $tempDir := file:create-temp-dir('test', 'example') let $x := xslt:transform-text($in, $xsl) return let $zip := archive:create-from($tempDir) return ( file:write-binary($zipPath, $zip) (: , file:delete($tempDir, true()) :) ) }; let $xsl := xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:xs=http://www.w3.org/2001/XMLSchema; version=2.0 xsl:template match=/ xsl:result-document href=doc1.xml testthis is a test 1 xsl:apply-templates//test /xsl:result-document xsl:result-document href=doc2.xml testthis is a test 2 xsl:apply-templates//test /xsl:result-document /xsl:template /xsl:stylesheet let $doc := testthis is input/test let $zipPath := 'report.zip' return local:example($doc, $xsl, $zipPath) The expected output is a zip file report.zip that contains doc1.xml and doc2.xml. However, what I'm seeing is that report.zip is created as an empty zip file and doc1.xml and doc2.xml are placed in BaseX's home directory. Thanks, Vincent
Re: [basex-talk] Round tripping JSON
…fixed, and available via the latest snapshot [1]. Thanks, Christian [1] http://files.basex.org/releases/latest On Mon, Aug 3, 2015 at 5:11 PM, Christian Grün christian.gr...@gmail.com wrote: Hi Marc, I'm using Postman. I already had Content-Type = application/json and Accept = application/json. I tried changing it to application/json;format=map I noticed that you get different result when specify 'format=basic' or 'format=direct': curl -XPUT -HContent-Type:application/json;format=basic -Tinput.json http://localhost:8984/test; ..so I guess something is going wrong here. I'll dive into this soon. (btw do you think it's necessary to have the basex/restxq specific pseudo attributes (format= etc) in the HTTP request headers?) You can also use %input:json(...) if you don't want to specify the format client-side. Maybe something to forward to Adam Retter / RESTXQ? So far, the content-type parameter extensions have not been adopted in RESTXQ yet, but feel free to give him an update! Christian
Re: [basex-talk] No debug info
Hi, I've simply used the client GUI. Should I see query logs in the server? In the past maybe the logs I've seen were always a result of the Java client queries, not the GUI. With kind regards, Menashè On 07/30/2015 10:23 AM, Christian Grün wrote: I don't know why I don't see anymore query log events like admin OK QUERY in the .logs folder. I need more information: When did you get these particular log info? Which API did you use? Any example available to reproduce that easily?
Re: [basex-talk] Applying indexes
Hi, So in case of six exact conditions (With different xpaths) should I see the usage of six indexes? Anyway, I'll send the exact query inside the old thread. On 07/30/2015 10:21 AM, Christian Grün wrote: Hi Menashè, Because none of our index structures is particularly suited for range queries, such index-driven requests may be slower than sequential scans. Maybe you remember my last mail: Have you already tried to store latitudes and longitudes in a fixed-size string representation? Sure, I've also responded to it: https://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg06648.html Best regards, Menashè
Re: [basex-talk] Applying indexes
So in case of six exact conditions (With different xpaths) should I see the usage of six indexes? It always depends on your data. My assumption is that you'll only have one index access in your optimized query. Sure, I've also responded to it: https://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg06648.html What about the next steps? Have you been successful?... https://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg06650.html https://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg06651.html
Re: [basex-talk] Slow query
On 08/03/2015 03:24 PM, Christian Grün wrote: What was the last version it was working with? 8.2.1. Not really working, but better...
[basex-talk] File permissions on .basex files
Hi, It seems that the commands and functions that operate on the .basex files, such as ADD and db:add(...), make the .basex files writable by the creator but not by anyone else. On the other hand, executing a query requires write permission for at least some of the .basex files, even if the query does not attempt to update the database. As a result, if I create a database and want anyone other than me to be able to use it (via the GUI, for example), I have to change permissions on the .basex files after creating the database. Apparently, I have to change the permissions again if I later update the database and rebuild the indexes. Do folks on this list have a slick way to keep the permissions as open as needed? I tried searching the list archive but didn't find anything that looked relevent. Would it be a reasonable enhancement request to make this a bit smoother? For example, an option could let you specify that the .basex files being created or modified should be writable by all. Alternatively or in addition, perhaps it is possible to stop requiring write permission for non-updating queries; I'm not familiar with the reason why write permission is needed. Thanks, Amanda
Re: [basex-talk] Slow query
I'm have again performance problems. I have BaseX 8.2.2. What was the last version it was working with?
Re: [basex-talk] Slow query
What was the last version it was working with? 8.2.1. Not really working, but better... I ran the attached query with 8.2.1, and no index was used either. Are you sure you sent me the correct query? Sorry for confronting you with all those questions, but to help you, I really need your help as well. Could you check the attached files again and give me some hints on how to proceed?
Re: [basex-talk] Slow query
I think I've already mentioned that the new query is different. The reference to 8.2.1 is included here where also the old query can be found: https://www.mail-archive.com/basex-talk%40mailman.uni-konstanz.de/msg06544.html With kind regards, Menashè On 08/03/2015 03:38 PM, Christian Grün wrote: What was the last version it was working with? 8.2.1. Not really working, but better... I ran the attached query with 8.2.1, and no index was used either. Are you sure you sent me the correct query? Sorry for confronting you with all those questions, but to help you, I really need your help as well. Could you check the attached files again and give me some hints on how to proceed?
Re: [basex-talk] Destination of result-document from XSLT module
Hi, I have an other problem is to control the serialization of the node passed to the transform function. I don't see how to control it. Marc Le 03/08/2015 22:32, Andy Bunce a écrit : Hi Max, This sounds like a good thing. Another solution to the result-document issue might be to implement the XQuery 3.1 transform function [1] /Andy [1] http://www.w3.org/TR/xpath-functions-31/#func-transform On 3 August 2015 at 20:54, Max Goltzsche max.goltzs...@algorythm.de mailto:max.goltzs...@algorythm.de wrote: Hello Vincent, besides an URI resolver I also want to set XSLT 2.0's output destination in BaseX. Currently as you can see in BaseX' xslt:transform and xslt:transform-text implementation in https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/query/func/xslt/XsltTransform.java there is neither an URIResolver or OutputURIResolver set on the Transformer nor a destination systemId set on its StreamResult. Thus Saxon resolves output paths relative to your Java process' working directory (in fact all relative XSL include, import, document and collection paths in the XSLT passed to the transform method). Unfortunately to change this behaviour the XsltTransform class must be enhanced. If you need a quicker* solution for your problem you may have to build your own BaseX transform Java Module based on the XsltTransform class setting at least the StreamResult's systemId I think. I will be also working on this the next evenings. best regards, Max On 03.08.2015 20:54, Lizzi, Vincent wrote: I’m trying to use the XSLT Module in BaseX 8.2.3 with Saxon 9.6 to run an XSLT that produces several output documents using xsl:result-document. I’m having trouble setting the location of the output documents. I want to have xsl:result-document create the output documents in a temporary folder because the documents need to be zipped together. __ __ According to Saxon’s documentation, the a relative path in the href attribute of xsl:result-document will be resolved using either the path of the Destination, or the current directory. The XSLT Module does not appear have a way to provide a path for a destination document. What I’m seeing is that the result documents are created in BaseX’s home directory. The XSLT works as expected when run using Saxon from the command line, where it’s possible to set a destination path. __ __ Is there a way to specify a Base Output URI to the XSLT Module? Or, would it be possible to specify a file URI output location to a method like xslt:transform? __ __ One possible workaround is to provide an absolute path as a parameter to the XSLT, and use that parameter in the xsl:result-document href location. __ __ Here is a self-contained example code: __ __ __ __ declare function local:example($in, $xsl, $zipPath) { let $tempDir := file:create-temp-dir('test', 'example') let $x := xslt:transform-text($in, $xsl) return let $zip := archive:create-from($tempDir) return ( file:write-binary($zipPath, $zip) (: , file:delete($tempDir, true()) :) ) }; __ __ __ __ let $xsl := xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; http://www.w3.org/1999/XSL/Transform xmlns:xs=http://www.w3.org/2001/XMLSchema; http://www.w3.org/2001/XMLSchema version=2.0 xsl:template match=/ xsl:result-document href=doc1.xml testthis is a test 1 xsl:apply-templates//test /xsl:result-document xsl:result-document href=doc2.xml testthis is a test 2 xsl:apply-templates//test /xsl:result-document /xsl:template /xsl:stylesheet __ __ let $doc := testthis is input/test __ __ let $zipPath := 'report.zip' __ __ return local:example($doc, $xsl, $zipPath) __ __ The expected output is a zip file report.zip that contains doc1.xml and doc2.xml. __ __ However, what I’m seeing is that report.zip is created as an empty zip file and doc1.xml and doc2.xml are placed in BaseX’s home directory. __ __ Thanks, Vincent
Re: [basex-talk] Destination of result-document from XSLT module
Thanks, Max and Andy. The XQuery 3.1 transform function looks promising. Marc, For controlling the serialization of XSLT output, you can specify serialization for the XSLT within the XSLT itself using xsl:output, run the XSLT using the xslt:transform-text, and then write the output to a file. file:write-text('file.txt', xslt:transform-text($doc, $xslt)) I'm not sure if this will do what you need, but so far it has been working for me. Vincent -Original Message- From: basex-talk-boun...@mailman.uni-konstanz.de [mailto:basex-talk-boun...@mailman.uni-konstanz.de] On Behalf Of Marc Sent: Monday, August 03, 2015 4:53 PM Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] Destination of result-document from XSLT module Hi, I have an other problem is to control the serialization of the node passed to the transform function. I don't see how to control it. Marc Le 03/08/2015 22:32, Andy Bunce a écrit : Hi Max, This sounds like a good thing. Another solution to the result-document issue might be to implement the XQuery 3.1 transform function [1] /Andy [1] http://www.w3.org/TR/xpath-functions-31/#func-transform On 3 August 2015 at 20:54, Max Goltzsche max.goltzs...@algorythm.de mailto:max.goltzs...@algorythm.de wrote: Hello Vincent, besides an URI resolver I also want to set XSLT 2.0's output destination in BaseX. Currently as you can see in BaseX' xslt:transform and xslt:transform-text implementation in https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/query/func/xslt/XsltTransform.java there is neither an URIResolver or OutputURIResolver set on the Transformer nor a destination systemId set on its StreamResult. Thus Saxon resolves output paths relative to your Java process' working directory (in fact all relative XSL include, import, document and collection paths in the XSLT passed to the transform method). Unfortunately to change this behaviour the XsltTransform class must be enhanced. If you need a quicker* solution for your problem you may have to build your own BaseX transform Java Module based on the XsltTransform class setting at least the StreamResult's systemId I think. I will be also working on this the next evenings. best regards, Max On 03.08.2015 20:54, Lizzi, Vincent wrote: I’m trying to use the XSLT Module in BaseX 8.2.3 with Saxon 9.6 to run an XSLT that produces several output documents using xsl:result-document. I’m having trouble setting the location of the output documents. I want to have xsl:result-document create the output documents in a temporary folder because the documents need to be zipped together. __ __ According to Saxon’s documentation, the a relative path in the href attribute of xsl:result-document will be resolved using either the path of the Destination, or the current directory. The XSLT Module does not appear have a way to provide a path for a destination document. What I’m seeing is that the result documents are created in BaseX’s home directory. The XSLT works as expected when run using Saxon from the command line, where it’s possible to set a destination path. __ __ Is there a way to specify a Base Output URI to the XSLT Module? Or, would it be possible to specify a file URI output location to a method like xslt:transform? __ __ One possible workaround is to provide an absolute path as a parameter to the XSLT, and use that parameter in the xsl:result-document href location. __ __ Here is a self-contained example code: __ __ __ __ declare function local:example($in, $xsl, $zipPath) { let $tempDir := file:create-temp-dir('test', 'example') let $x := xslt:transform-text($in, $xsl) return let $zip := archive:create-from($tempDir) return ( file:write-binary($zipPath, $zip) (: , file:delete($tempDir, true()) :) ) }; __ __ __ __ let $xsl := xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; http://www.w3.org/1999/XSL/Transform xmlns:xs=http://www.w3.org/2001/XMLSchema; http://www.w3.org/2001/XMLSchema version=2.0 xsl:template match=/ xsl:result-document href=doc1.xml testthis is a test 1 xsl:apply-templates//test /xsl:result-document xsl:result-document href=doc2.xml testthis is a test 2 xsl:apply-templates//test /xsl:result-document /xsl:template /xsl:stylesheet __ __ let $doc := testthis is
Re: [basex-talk] Destination of result-document from XSLT module
Hi Max, This sounds like a good thing. Another solution to the result-document issue might be to implement the XQuery 3.1 transform function [1] /Andy [1] http://www.w3.org/TR/xpath-functions-31/#func-transform On 3 August 2015 at 20:54, Max Goltzsche max.goltzs...@algorythm.de wrote: Hello Vincent, besides an URI resolver I also want to set XSLT 2.0's output destination in BaseX. Currently as you can see in BaseX' xslt:transform and xslt:transform-text implementation in https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/query/func/xslt/XsltTransform.java there is neither an URIResolver or OutputURIResolver set on the Transformer nor a destination systemId set on its StreamResult. Thus Saxon resolves output paths relative to your Java process' working directory (in fact all relative XSL include, import, document and collection paths in the XSLT passed to the transform method). Unfortunately to change this behaviour the XsltTransform class must be enhanced. If you need a quicker* solution for your problem you may have to build your own BaseX transform Java Module based on the XsltTransform class setting at least the StreamResult's systemId I think. I will be also working on this the next evenings. best regards, Max On 03.08.2015 20:54, Lizzi, Vincent wrote: I’m trying to use the XSLT Module in BaseX 8.2.3 with Saxon 9.6 to run an XSLT that produces several output documents using xsl:result-document. I’m having trouble setting the location of the output documents. I want to have xsl:result-document create the output documents in a temporary folder because the documents need to be zipped together. According to Saxon’s documentation, the a relative path in the href attribute of xsl:result-document will be resolved using either the path of the Destination, or the current directory. The XSLT Module does not appear have a way to provide a path for a destination document. What I’m seeing is that the result documents are created in BaseX’s home directory. The XSLT works as expected when run using Saxon from the command line, where it’s possible to set a destination path. Is there a way to specify a Base Output URI to the XSLT Module? Or, would it be possible to specify a file URI output location to a method like xslt:transform? One possible workaround is to provide an absolute path as a parameter to the XSLT, and use that parameter in the xsl:result-document href location. Here is a self-contained example code: declare function local:example($in, $xsl, $zipPath) { let $tempDir := file:create-temp-dir('test', 'example') let $x := xslt:transform-text($in, $xsl) return let $zip := archive:create-from($tempDir) return ( file:write-binary($zipPath, $zip) (: , file:delete($tempDir, true()) :) ) }; let $xsl := xsl:stylesheet xmlns:xsl= http://www.w3.org/1999/XSL/Transform; http://www.w3.org/1999/XSL/Transform xmlns:xs= http://www.w3.org/2001/XMLSchema; http://www.w3.org/2001/XMLSchema version=2.0 xsl:template match=/ xsl:result-document href=doc1.xml testthis is a test 1 xsl:apply-templates//test /xsl:result-document xsl:result-document href=doc2.xml testthis is a test 2 xsl:apply-templates//test /xsl:result-document /xsl:template /xsl:stylesheet let $doc := testthis is input/test let $zipPath := 'report.zip' return local:example($doc, $xsl, $zipPath) The expected output is a zip file report.zip that contains doc1.xml and doc2.xml. However, what I’m seeing is that report.zip is created as an empty zip file and doc1.xml and doc2.xml are placed in BaseX’s home directory. Thanks, Vincent
Re: [basex-talk] Destination of result-document from XSLT module
Hello Vincent, besides an URI resolver I also want to set XSLT 2.0's output destination in BaseX. Currently as you can see in BaseX' xslt:transform and xslt:transform-text implementation in https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/query/func/xslt/XsltTransform.java there is neither an URIResolver or OutputURIResolver set on the Transformer nor a destination systemId set on its StreamResult. Thus Saxon resolves output paths relative to your Java process' working directory (in fact all relative XSL include, import, document and collection paths in the XSLT passed to the transform method). Unfortunately to change this behaviour the XsltTransform class must be enhanced. If you need a quicker* solution for your problem you may have to build your own BaseX transform Java Module based on the XsltTransform class setting at least the StreamResult's systemId I think. I will be also working on this the next evenings. best regards, Max On 03.08.2015 20:54, Lizzi, Vincent wrote: I’m trying to use the XSLT Module in BaseX 8.2.3 with Saxon 9.6 to run an XSLT that produces several output documents using xsl:result-document. I’m having trouble setting the location of the output documents. I want to have xsl:result-document create the output documents in a temporary folder because the documents need to be zipped together. According to Saxon’s documentation, the a relative path in the href attribute of xsl:result-document will be resolved using either the path of the Destination, or the current directory. The XSLT Module does not appear have a way to provide a path for a destination document. What I’m seeing is that the result documents are created in BaseX’s home directory. The XSLT works as expected when run using Saxon from the command line, where it’s possible to set a destination path. Is there a way to specify a Base Output URI to the XSLT Module? Or, would it be possible to specify a file URI output location to a method like xslt:transform? One possible workaround is to provide an absolute path as a parameter to the XSLT, and use that parameter in the xsl:result-document href location. Here is a self-contained example code: declare function local:example($in, $xsl, $zipPath) { let $tempDir := file:create-temp-dir('test', 'example') let $x := xslt:transform-text($in, $xsl) return let $zip := archive:create-from($tempDir) return ( file:write-binary($zipPath, $zip) (: , file:delete($tempDir, true()) :) ) }; let $xsl := xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:xs=http://www.w3.org/2001/XMLSchema; version=2.0 xsl:template match=/ xsl:result-document href=doc1.xml testthis is a test 1 xsl:apply-templates//test /xsl:result-document xsl:result-document href=doc2.xml testthis is a test 2 xsl:apply-templates//test /xsl:result-document /xsl:template /xsl:stylesheet let $doc := testthis is input/test let $zipPath := 'report.zip' return local:example($doc, $xsl, $zipPath) The expected output is a zip file report.zip that contains doc1.xml and doc2.xml. However, what I’m seeing is that report.zip is created as an empty zip file and doc1.xml and doc2.xml are placed in BaseX’s home directory. Thanks, Vincent