Christian,
Vielen Dank! This is exactly what I was wondering about. Thank you for pointing me in the right direction.
Joshua
-----Original Message----- From: Christian Grün christian.gruen@gmail.com Sent: Wednesday, May 15, 2019 12:41 PM To: Joshua Kordani joshua.kordani@speedcastwireless.com; BaseX basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] New user questions
Hallo Joshua (cc to the list).
If you want to process data that is bound to environment variables or system properties, you can use fn:environment-variable or proc:property [1].
In the prolog of your XQuery module, you can specify external variables. If you call BaseX on command line, values can be bound to these variables via the -b option:
query.xq: declare variable $v external; $v * $v
command-line call: basex -b v=123 query.xq 15129
XQuery itself is a very powerful language, and the built-in BaseX XQuery modules allow you to do many things that you are used from other programming languages (accessing files, sending HTTP requests, processing archives, JSON, HTML, etc) [3]. If you should require features that are not part of XQuery of the provided languages, you can also resort to Java code [4] or integrate additional modules [5].
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Process_Module#proc:property [2] http://docs.basex.org/wiki/Command-Line_Options#Standalone [3] http://docs.basex.org/wiki/Module_Library [4] http://docs.basex.org/wiki/Java_Bindings [5] http://docs.basex.org/wiki/Repository
On Wed, May 15, 2019 at 6:30 PM Joshua Kordani joshua.kordani@speedcastwireless.com wrote:
Christian,
Thank you for your reply! I feel confident in my ability to construct the system in question, but I'm wondering how much of it will live in XQuery and how much will remain outside. As I've read through the documentation in more detail since my initial email, I do not see how the current offerings of XQuery modules will provide this functionality (I.e. user input either from environment variables or command line options fed to XQuery scripts) nor do I see this in the various tools command line options although I have not exhaustively searched. If I am wrong, I would appreciate a pointer to such, otherwise I suppose the answer will have to come from using the BaseX libraries or APIs. Do I have this right?
Danke, Joshua Kordani
-----Original Message----- From: Christian Grün christian.gruen@gmail.com Sent: Wednesday, May 15, 2019 5:36 AM To: Joshua Kordani joshua.kordani@speedcastwireless.com Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] New user questions
Dear Joshua,
I believe there are many ways to build a system you are envisioning; but I am not sure how to answer your question(s). If you are looking for someone who could build an individual software solution for you, based on BaseX, we invite you to write to info@basexgmbh.de and ask for our commercial services.
Hope this helps, Christian
On Tue, May 14, 2019 at 5:22 AM Joshua Kordani joshua.kordani@speedcastwireless.com wrote:
Greetings all.
I am attempting to setup an environment for processing junit xml output files, to be handed off to the end user.
In general, batches of junit files will be imported over time, and as they get imported I wish to add timestamp tags to certain elements. Right now the only way I see to programmatically do this is take details from the filename, derive a datetime, and apply it to the elements in question that are associated with a given file. I am trying to make this process easy on the user, such that they specify a new file or set of files to import, then all pertinent records in each file get timestamped. I don't quite see how to access enough "external environment" to allow for a script to grab a user specified filename and do this work and I could use some pointers. I undertand that datetimes are not indexable fields, or else i'm not sure exactly what the documentation has to say about indexes and datetimes, but if there is anything I can do to allow a user to filter by them that would be great.
The user is fine with what ultimately becomes a command line interface to import these files and generates reports. I can see how to build xquery commands to isolate all of the elements in question and pass statically baked data to variables such as date time to add to existing elements in the database, but I still am not sure how to use this to build a system to allow a user to add a file or set of files at a time and have them processed in this way.
Thank you! Joshua Kordani
DISCLAIMER: This email communication and any attached files are Speedcast Wireless proprietary and may be legally privileged. Export-controlled information shall not be disseminated without proper authorization and proper export-control markings, per Speedcast Wireless export policy. If you have received this transmission in error please notify the sender immediately and then delete this email and all its attachments. If you are not the addressee, any disclosure, reproduction, copying, distribution, or any other dissemination or use of this communication is strictly prohibited. Thank you.
DISCLAIMER: This email communication and any attached files are Speedcast Wireless proprietary and may be legally privileged. Export-controlled information shall not be disseminated without proper authorization and proper export-control markings, per Speedcast Wireless export policy. If you have received this transmission in error please notify the sender immediately and then delete this email and all its attachments. If you are not the addressee, any disclosure, reproduction, copying, distribution, or any other dissemination or use of this communication is strictly prohibited. Thank you.