CREATEFILTER Setting Not Being Applied

Saturday, 26 February 2022 · 5 messages · last reply 2 Mar 2022
EK
Eliot Kimber26 Feb 2022 15:05 #
In my basex/.basex file I have this local option: # Local Options CREATEFILTER=*.xml,*.dita,*.ditamap I have three BaseX instances running. And in the DBA panel for an instance not running on the default port (i.e., on port 10894) I see this in the Local Options column: CREATEFILTER *.xml,*.dita,*.ditamap SKIPCORRUPT ✓ However, if I do this from the Query console of that same server:
db:create(‘mydatabase’, ‘/path/to/docs’)
The resulting database only reflects .xml files, not .dita or .ditamap files. I’m wondering if this is a bug in how CREATEFILTER is being applied or my misunderstanding of the implications for CREATEFILTER? This is running 9.6.4 on Centos. If I specify createfilter directly on the db:create() call then of course it works as expected. Cheers, E. _____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.com<https://www.servicenow.com> LinkedIn<https://www.linkedin.com/company/servicenow> | Twitter<https://twitter.com/servicenow> | YouTube<https://www.youtube.com/user/servicenowinc> | Facebook<https://www.facebook.com/servicenow>
CG
Christian Grün28 Feb 2022 16:22 #
Hi Eliot, I was surprised to see your observation leading me back to an adjustment made in 2014. Back then, global parsing options erroneously influenced the behavior of fn:doc. The global value of the CREATEFILTER, among others, is now considered when using db:create. See [1] for the whole picture and [2] for a new snapshot. Cheers, Christian [1] https://github.com/BaseXdb/basex/issues/2072 [2] https://files.basex.org/releases/latest/
Quoted text · Eliot Kimber · 83 lines
On Sat, Feb 26, 2022 at 3:05 PM Eliot Kimber <eliot.kimber at servicenow.com> wrote: > In my basex/.basex file I have this local option: > > > > # Local Options > > CREATEFILTER=*.xml,*.dita,*.ditamap > > > > I have three BaseX instances running. > > > > And in the DBA panel for an instance not running on the default port > (i.e., on port 10894) I see this in the Local Options column: > > > > *CREATEFILTER* > > *.xml,*.dita,*.ditamap > > *SKIPCORRUPT* > > ✓ > > > > > > However, if I do this from the Query console of that same server: > > > > db:create(‘mydatabase’, ‘/path/to/docs’) > > > > The resulting database only reflects .xml files, not .dita or .ditamap > files. > > > > I’m wondering if this is a bug in how CREATEFILTER is being applied or my > misunderstanding of the implications for CREATEFILTER? > > > > This is running 9.6.4 on Centos. > > > > If I specify createfilter directly on the db:create() call then of course > it works as expected. > > > > Cheers, > > > > E. > > _____________________________________________ > > *Eliot Kimber* > > Sr Staff Content Engineer > > O: 512 554 9368 > > M: 512 554 9368 > > servicenow.com <https://www.servicenow.com> > > LinkedIn <https://www.linkedin.com/company/servicenow> | Twitter > <https://twitter.com/servicenow> | YouTube > <https://www.youtube.com/user/servicenowinc> | Facebook > <https://www.facebook.com/servicenow> >
EK
Eliot Kimber28 Feb 2022 16:37 #
Thanks for fixing it—glad to know it wasn’t just me 😊 Cheers, E. _____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.com<https://www.servicenow.com> LinkedIn<https://www.linkedin.com/company/servicenow> | Twitter<https://twitter.com/servicenow> | YouTube<https://www.youtube.com/user/servicenowinc> | Facebook<https://www.facebook.com/servicenow>
Quoted text · Christian Grün · 36 lines
From: Christian Grün <christian.gruen at gmail.com> Date: Monday, February 28, 2022 at 9:24 AM To: Eliot Kimber <eliot.kimber at servicenow.com> Cc: basex-talk at mailman.uni-konstanz.de <basex-talk at mailman.uni-konstanz.de> Subject: Re: [basex-talk] CREATEFILTER Setting Not Being Applied [External Email] Hi Eliot, I was surprised to see your observation leading me back to an adjustment made in 2014. Back then, global parsing options erroneously influenced the behavior of fn:doc. The global value of the CREATEFILTER, among others, is now considered when using db:create. See [1] for the whole picture and [2] for a new snapshot. Cheers, Christian [1] https://github.com/BaseXdb/basex/issues/2072<https://urldefense.com/v3/__https:/github.com/BaseXdb/basex/issues/2072__;!!N4vogdjhuJM!RG28s11PwUaBYEp5KOVE7ZHiZEyX59rxlvpkoEsxjtl51-KzPEMXlGnU4tAf-4grq3aEpg$> [2] https://files.basex.org/releases/latest/<https://urldefense.com/v3/__https:/files.basex.org/releases/latest/__;!!N4vogdjhuJM!RG28s11PwUaBYEp5KOVE7ZHiZEyX59rxlvpkoEsxjtl51-KzPEMXlGnU4tAf-4gjkX1iZA$> On Sat, Feb 26, 2022 at 3:05 PM Eliot Kimber <eliot.kimber at servicenow.com<mailto:eliot.kimber at servicenow.com>> wrote: In my basex/.basex file I have this local option: # Local Options CREATEFILTER=*.xml,*.dita,*.ditamap I have three BaseX instances running. And in the DBA panel for an instance not running on the default port (i.e., on port 10894) I see this in the Local Options column: CREATEFILTER *.xml,*.dita,*.ditamap SKIPCORRUPT ✓ However, if I do this from the Query console of that same server: db:create(‘mydatabase’, ‘/path/to/docs’) The resulting database only reflects .xml files, not .dita or .ditamap files. I’m wondering if this is a bug in how CREATEFILTER is being applied or my misunderstanding of the implications for CREATEFILTER? This is running 9.6.4 on Centos. If I specify createfilter directly on the db:create() call then of course it works as expected. Cheers, E. Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.com<https://www.servicenow.com> LinkedIn<https://urldefense.com/v3/__https:/www.linkedin.com/company/servicenow__;!!N4vogdjhuJM!RG28s11PwUaBYEp5KOVE7ZHiZEyX59rxlvpkoEsxjtl51-KzPEMXlGnU4tAf-4jHKPZvmw$> | Twitter<https://urldefense.com/v3/__https:/twitter.com/servicenow__;!!N4vogdjhuJM!RG28s11PwUaBYEp5KOVE7ZHiZEyX59rxlvpkoEsxjtl51-KzPEMXlGnU4tAf-4i_xBtN3Q$> | YouTube<https://urldefense.com/v3/__https:/www.youtube.com/user/servicenowinc__;!!N4vogdjhuJM!RG28s11PwUaBYEp5KOVE7ZHiZEyX59rxlvpkoEsxjtl51-KzPEMXlGnU4tAf-4iiSK5jrw$> | Facebook<https://urldefense.com/v3/__https:/www.facebook.com/servicenow__;!!N4vogdjhuJM!RG28s11PwUaBYEp5KOVE7ZHiZEyX59rxlvpkoEsxjtl51-KzPEMXlGnU4tAf-4hNB0Xwzg$>
PD
Patrick Durusauin reply to Christian Grün, 28 Feb 2022, 16:222 Mar 2022 02:39 #
Greetings! What I thought would be a simple task has turned out to not be so simple.
Quoted text · Christian Grün · 1 line
I wrote:
SET CHOP false
SET EXPORTER indent=no,omit-xml-declaration=no
SET BINDINGS $ndb=Ruth
CREATE DB $ndb ./sources/Ruth.xml
In BaseX 9.6.4, and when testing it I got this result: CHOP: false EXPORTER: indent=no,omit-xml-declaration=no BINDINGS: $ndb=Ruth Database '$ndb' created in 544.5 ms. What? Why isn't the mapping of Ruth to the variable $ndb effective in the bxs file? Moreover, there are query files that follow in the bxs file that I want to have resolve $ndb to Ruth (the desired name of the database). 1) How should I declare a variable in a bxs file? 2) In such a way that it carries over to following xquery files? BTW, I've seen this posting by Christian: https://stackoverflow.com/questions/28018354/how-to-run-a-xquery-with-xml-file-containing-value-as-one-of-the-bound-variabl but it doesn't seem to be working for me. What am I missing? Thanks! Patrick <https://twitter.com/servicenow>-- Patrick Durusau patrick at durusau.net Technical Advisory Board, OASIS (TAB) Editor, OpenDocument Format TC (OASIS), Project Editor ISO/IEC 26300 Co-Editor, ISO/IEC 13250-1, 13250-5 (Topic Maps) Another Word For It (blog): http://tm.durusau.net Homepage: http://www.durusau.net Twitter: patrickDurusau
EF
ETANCHAUD Fabrice2 Mar 2022 07:39 #
Hi Patrick, I don't think bxs scripts have something like variables (but I may have missed the point with all the work BaseX team achieves). Bindings are way to parametrize XQuery scripts, and you can indeed set external variables' value in bxs, or on command line. Best regards, Fabrice Here are a few examples : https://docs.basex.org/wiki/Options#BINDINGS Options - BaseX Documentation<https://docs.basex.org/wiki/Options#BINDINGS> This page is linked from the Getting Started Section.. The options listed on this page influence the way how database commands are executed and XQuery expressions are evaluated. Two kinds of options exist: Global Options are valid for all BaseX instances in the same JVM. This is particularly relevant if you are working with the client/server architecture. docs.basex.org https://docs.basex.org/wiki/Command-Line_Options Command-Line Options - BaseX Documentation<https://docs.basex.org/wiki/Command-Line_Options> Standalone []. The following options are available for the standalone Command-Line Client: $ basex -h BaseX [Standalone] Usage: basex [-bcdiIoqrRstuvVwxz] [input] [input] XQuery or command file, or query string -b<args> Bind external query variables -c<input> Execute commands from file or string -d Toggle debugging output -i<input> Bind file or database to context -I<input> Bind input string ... docs.basex.org
Quoted text · BaseX-Talk de la part de Patrick Durusau · 37 lines
De: BaseX-Talk de la part de Patrick Durusau Envoyé: Mercredi 02 mars 2022 01:38 À: basex-talk at mailman.uni-konstanz.de Objet: [basex-talk] Declaring a variable in bxs that carries over to called xquery scripts Greetings! What I thought would be a simple task has turned out to not be so simple. I wrote: SET CHOP false SET EXPORTER indent=no,omit-xml-declaration=no SET BINDINGS $ndb=Ruth CREATE DB $ndb ./sources/Ruth.xml In BaseX 9.6.4, and when testing it I got this result: CHOP: false EXPORTER: indent=no,omit-xml-declaration=no BINDINGS: $ndb=Ruth Database '$ndb' created in 544.5 ms. What? Why isn't the mapping of Ruth to the variable $ndb effective in the bxs file? Moreover, there are query files that follow in the bxs file that I want to have resolve $ndb to Ruth (the desired name of the database). 1) How should I declare a variable in a bxs file? 2) In such a way that it carries over to following xquery files? BTW, I've seen this posting by Christian: https://stackoverflow.com/questions/28018354/how-to-run-a-xquery-with-xml-file-containing-value-as-one-of-the-bound-variabl but it doesn't seem to be working for me. What am I missing? Thanks! Patrick <https://twitter.com/servicenow>-- Patrick Durusau patrick at durusau.net Technical Advisory Board, OASIS (TAB) Editor, OpenDocument Format TC (OASIS), Project Editor ISO/IEC 26300 Co-Editor, ISO/IEC 13250-1, 13250-5 (Topic Maps) Another Word For It (blog): http://tm.durusau.net Homepage: http://www.durusau.net Twitter: patrickDurusau

⚡Generated with XQuery