I think this is a bug:
I’m using db:create() to initialize a database with files from the file system. The OS is linux (but I see the same issue with macOS).
The docs all load without error, but then when processing the loaded content with code that uses base-uri() to get the base URI of a document, I get this failure:
URI '/rome/product/human-resources/task/predict-assignment-group[1].dita' is invalid
Which is correct—the square brackets must be escaped.
However, I didn’t create the URI, BaseX did when it loaded the data, which suggests that there’s a URI escaping action that isn’t being performed when the data is loaded: I would expect the URI to be “predict-assignment-group%5B1%5D.dita” as returned by base-uri() (and as stored in the <resource> entry for the document).
If I do:
collection('/rome/product/human-resources/task/predict-assignment-group[1].dita')/*
I also get invalid collection URI: '/rome/product/human-resources/task/predict-assignment-group[1].dita'
Using db:dir to examine the <resource> entry for the file I see:
<resource raw="false" content-type="application/xml" modified-date="2022-02-03T22:44:29.107Z">predict-assignment-group[1].dita</resource>
So the brackets are not escaped there.
I can use the db:* functions to correct the paths (or just delete the nodes) so not a hard-stop problem.
Cheers,
E. _____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.comhttps://www.servicenow.com LinkedInhttps://www.linkedin.com/company/servicenow | Twitterhttps://twitter.com/servicenow | YouTubehttps://www.youtube.com/user/servicenowinc | Facebookhttps://www.facebook.com/servicenow
This is related to an older open issue on GitHub [1]; I hope I can fix it with BaseX 10.
Best, Christian
[1] https://github.com/BaseXdb/basex/issues/1172
Eliot Kimber eliot.kimber@servicenow.com schrieb am Fr., 4. Feb. 2022, 01:54:
I think this is a bug:
I’m using db:create() to initialize a database with files from the file system. The OS is linux (but I see the same issue with macOS).
The docs all load without error, but then when processing the loaded content with code that uses base-uri() to get the base URI of a document, I get this failure:
*URI '/rome/product/human-resources/task/predict-assignment-group[1].dita' is invalid*
Which is correct—the square brackets must be escaped.
However, I didn’t create the URI, BaseX did when it loaded the data, which suggests that there’s a URI escaping action that isn’t being performed when the data is loaded: I would expect the URI to be “ *predict-assignment-group%5B1%5D.dita”* as returned by base-uri() (and as stored in the <resource> entry for the document).
If I do:
collection('/rome/product/human-resources/task/predict-assignment-group[1].dita')/*
I also get i*nvalid collection URI: '/rome/product/human-resources/task/predict-assignment-*group[1].dita'
Using db:dir to examine the <resource> entry for the file I see:
<resource raw="false" content-type="application/xml" modified-date="2022-02-03T22:44:29.107Z">predict-assignment-group[1].dita</resource>
So the brackets are not escaped there.
I can use the db:* functions to correct the paths (or just delete the nodes) so not a hard-stop problem.
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
Reported by Eliot himself…
On 04.02.2022 11:15, Christian Grün wrote:
This is related to an older open issue on GitHub [1]; I hope I can fix it with BaseX 10.
Best, Christian
[1] https://github.com/BaseXdb/basex/issues/1172 https://github.com/BaseXdb/basex/issues/1172
Eliot Kimber <eliot.kimber@servicenow.com mailto:eliot.kimber@servicenow.com> schrieb am Fr., 4. Feb. 2022, 01:54:
I think this is a bug:
…
That feeling when you search stackoverflow to only find your own question from 2 years ago :)
Imsieke, Gerrit, le-tex gerrit.imsieke@le-tex.de schrieb am Fr., 4. Feb. 2022, 11:20:
Reported by Eliot himself…
On 04.02.2022 11:15, Christian Grün wrote:
This is related to an older open issue on GitHub [1]; I hope I can fix it with BaseX 10.
Best, Christian
[1] https://github.com/BaseXdb/basex/issues/1172 https://github.com/BaseXdb/basex/issues/1172
Eliot Kimber <eliot.kimber@servicenow.com mailto:eliot.kimber@servicenow.com> schrieb am Fr., 4. Feb. 2022,
01:54:
I think this is a bug:
…
I thought this issue seemed oddly familiar… 2015 was a long time ago—I can barely remember what I had for breakfast.
A fix would be welcome but clearly it’s not a show stopper…
Cheers,
E.
_____________________________________________ Eliot Kimber Sr Staff Content Engineer O: 512 554 9368 M: 512 554 9368 servicenow.comhttps://www.servicenow.com LinkedInhttps://www.linkedin.com/company/servicenow | Twitterhttps://twitter.com/servicenow | YouTubehttps://www.youtube.com/user/servicenowinc | Facebookhttps://www.facebook.com/servicenow
From: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de on behalf of Maximilian Gärber mgaerber@arcor.de Date: Friday, February 4, 2022 at 5:39 AM To: Imsieke, Gerrit, le-tex gerrit.imsieke@le-tex.de, BaseX basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] Doc Loaded by db:create() has invalid URL according to base-uri() [External Email]
That feeling when you search stackoverflow to only find your own question from 2 years ago :)
Imsieke, Gerrit, le-tex <gerrit.imsieke@le-tex.demailto:gerrit.imsieke@le-tex.de> schrieb am Fr., 4. Feb. 2022, 11:20: Reported by Eliot himself…
On 04.02.2022 11:15, Christian Grün wrote:
This is related to an older open issue on GitHub [1]; I hope I can fix it with BaseX 10.
Best, Christian
[1] https://github.com/BaseXdb/basex/issues/1172https://urldefense.com/v3/__https:/github.com/BaseXdb/basex/issues/1172__;!!N4vogdjhuJM!VeOvz4uESlLkjVGt2d1IcJeDHKxoztQVyeVYmOqcyQ7EcHpMqGGuyADIJNwGufXyqjLdUA$ <https://github.com/BaseXdb/basex/issues/1172https://urldefense.com/v3/__https:/github.com/BaseXdb/basex/issues/1172__;!!N4vogdjhuJM!VeOvz4uESlLkjVGt2d1IcJeDHKxoztQVyeVYmOqcyQ7EcHpMqGGuyADIJNwGufXyqjLdUA$>
Eliot Kimber <eliot.kimber@servicenow.commailto:eliot.kimber@servicenow.com <mailto:eliot.kimber@servicenow.commailto:eliot.kimber@servicenow.com>> schrieb am Fr., 4. Feb. 2022, 01:54:
I think this is a bug:
…
basex-talk@mailman.uni-konstanz.de