Bonjour,
Je me permets de vous contacter dans le cadre de mon doctorat en histoire médiévale. Je souhaiterai en effet organiser le dépouillement de mes archives à l'aide d'une base de données en XML en utilisant le logiciel BaseX, mais je suis face à une difficulté que je n'arrive pas à surmonter dans son utilisation. Cette difficulté est liée à l'utilisation de la balise xi:include.
J'ai tenté de produire un exemple minimaliste avec deux fichiers dans un même répertoire pour voir ce qui ne marche pas :
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
Alors que ces deux fichiers sont décrits comme valides par Oxygen, l'importation du fichier music.xml avec BaseX (que ce soit avec l'interface DBA ou l'interface GUI) génère systématiquement l'erreur suivante : "An include with href 'label.xml'failed, and no fallback element was found". Je peux en revanche importer le fichier dans la base de données via Oxygen et l'utilisation du WebDAV de BaseX, mais le fichier est alors indiqué comme étant de type "binary" et est absolument inemployable pour réaliser des requêtes.
J'ai pourtant tenté de réaliser la requête suivante au sein de ma DB dans BaseX GUI, ce qui n'a pas renvoyé d'erreurs :
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
J'ai également tenté de charger ces mêmes fichiers dans eXist DB, et l'inclusion s'est réalisée sans problèmes. Je ne comprends donc pas ce qui ne va pas avec l'utilisation de XInclude dans BaseX. Est-ce qu'il y a un problème avec la résolution des URI ?
Je travaille sous Windows 10 (j'ai aussi fait des tests sur Ubuntu et obtenu le même résultat), BaseX 10.4 et Java 1.8.0_361.
Est-ce que c'est quelque chose qui vous est déjà arrivé ? J'ai essayé de chercher dans les archives mail de basex-talk et trouvé quelques problèmes similaires, mais qui ont été résolus par l'emploi de BaseX GUI. Or chez moi cela marche aussi mal avec GUI qu'avec DBA. Je peux transférer mon travail sur eXist DB, mais j'avoue m'être assez familiarisé avec BaseX et souhaiterai rester sur ce logiciel tant que possible. Je suis donc preneur de toutes vos propositions.
En vous remerciant par avance pour vos réponses,
Bien cordialement,
Virgile Reignier
Hello,
I am contacting you as part of my PhD in medieval history. I would like to organise the analysis of my archives with the help of an XML database using the BaseX software, but I am encountering a difficulty that I cannot overcome in its use. This difficulty is related to the use of the xi:include tag.
I tried to produce a minimalist example with two files in the same directory to see what goes wrong:
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
While both files are described as valid by Oxygen, importing the music.xml file with BaseX (either with the DBA interface or the GUI interface) consistently generates the following error: "An include with href 'label.xml'failed, and no fallback element was found". I can import the file into the database via Oxygen and the use of BaseX WebDAV, but the file is then indicated as being of type "binary" and is absolutely unusable for queries.
However, I tried to perform the following query within my DB in BaseX GUI, which did not return any errors:
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
I also tried to load these same files into eXist DB, and the inclusion was successful. So I don't understand what is wrong with using XInclude in BaseX. Is there a problem with URI resolution?
I'm working on Windows 10 (I also tested on Ubuntu and got the same result), BaseX 10.4 and Java 1.8.0_361.
Is this something that has happened to you before? I tried to search the basex-talk mail archives and found some similar problems, but they were solved by using BaseX GUI. However, in my case it works just as badly with GUI as with DBA. I can transfer my work to eXist DB, but I have become quite familiar with BaseX and would like to stay with it as long as possible. I am therefore interested in any suggestions you may have.
Thank you in advance for your answers,
Virgile Reignier
While this may not solve your problem, I can confirm that your files import just fine with BaseX 10.3 GUI on my Windows machine. There is a checkbox in the import dialog "Use XInclude", but it works regardless whether the I check or uncheck the box.
-----Ursprüngliche Nachricht----- Von: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de Im Auftrag von Virgile Reignier Gesendet: Dienstag, 14. März 2023 18:55 An: basex-talk@mailman.uni-konstanz.de Betreff: [basex-talk] Problem with using XInclude in BaseX
Bonjour,
Je me permets de vous contacter dans le cadre de mon doctorat en histoire médiévale. Je souhaiterai en effet organiser le dépouillement de mes archives à l'aide d'une base de données en XML en utilisant le logiciel BaseX, mais je suis face à une difficulté que je n'arrive pas à surmonter dans son utilisation. Cette difficulté est liée à l'utilisation de la balise xi:include.
J'ai tenté de produire un exemple minimaliste avec deux fichiers dans un même répertoire pour voir ce qui ne marche pas :
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
Alors que ces deux fichiers sont décrits comme valides par Oxygen, l'importation du fichier music.xml avec BaseX (que ce soit avec l'interface DBA ou l'interface GUI) génère systématiquement l'erreur suivante : "An include with href 'label.xml'failed, and no fallback element was found". Je peux en revanche importer le fichier dans la base de données via Oxygen et l'utilisation du WebDAV de BaseX, mais le fichier est alors indiqué comme étant de type "binary" et est absolument inemployable pour réaliser des requêtes.
J'ai pourtant tenté de réaliser la requête suivante au sein de ma DB dans BaseX GUI, ce qui n'a pas renvoyé d'erreurs :
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
J'ai également tenté de charger ces mêmes fichiers dans eXist DB, et l'inclusion s'est réalisée sans problèmes. Je ne comprends donc pas ce qui ne va pas avec l'utilisation de XInclude dans BaseX. Est-ce qu'il y a un problème avec la résolution des URI ?
Je travaille sous Windows 10 (j'ai aussi fait des tests sur Ubuntu et obtenu le même résultat), BaseX 10.4 et Java 1.8.0_361.
Est-ce que c'est quelque chose qui vous est déjà arrivé ? J'ai essayé de chercher dans les archives mail de basex-talk et trouvé quelques problèmes similaires, mais qui ont été résolus par l'emploi de BaseX GUI. Or chez moi cela marche aussi mal avec GUI qu'avec DBA. Je peux transférer mon travail sur eXist DB, mais j'avoue m'être assez familiarisé avec BaseX et souhaiterai rester sur ce logiciel tant que possible. Je suis donc preneur de toutes vos propositions.
En vous remerciant par avance pour vos réponses,
Bien cordialement,
Virgile Reignier
Hello,
I am contacting you as part of my PhD in medieval history. I would like to organise the analysis of my archives with the help of an XML database using the BaseX software, but I am encountering a difficulty that I cannot overcome in its use. This difficulty is related to the use of the xi:include tag.
I tried to produce a minimalist example with two files in the same directory to see what goes wrong:
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
While both files are described as valid by Oxygen, importing the music.xml file with BaseX (either with the DBA interface or the GUI interface) consistently generates the following error: "An include with href 'label.xml'failed, and no fallback element was found". I can import the file into the database via Oxygen and the use of BaseX WebDAV, but the file is then indicated as being of type "binary" and is absolutely unusable for queries.
However, I tried to perform the following query within my DB in BaseX GUI, which did not return any errors:
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
I also tried to load these same files into eXist DB, and the inclusion was successful. So I don't understand what is wrong with using XInclude in BaseX. Is there a problem with URI resolution?
I'm working on Windows 10 (I also tested on Ubuntu and got the same result), BaseX 10.4 and Java 1.8.0_361.
Is this something that has happened to you before? I tried to search the basex-talk mail archives and found some similar problems, but they were solved by using BaseX GUI. However, in my case it works just as badly with GUI as with DBA. I can transfer my work to eXist DB, but I have become quite familiar with BaseX and would like to stay with it as long as possible. I am therefore interested in any suggestions you may have.
Thank you in advance for your answers,
Virgile Reignier
Hi Daniel,
Even if it is indirect, you have solved my problem. As I read you, I quickly reinstalled BaseX to see if the problem could be with version 10.4. And re-importing my database made me pay attention to a little "Use internal XML parser" checkbox in the import dialog. If I check it, everything suddenly starts working properly. I tried again with the 10.4 and it's really this checkbox that makes the difference. I don't realise what impact this might have, but I can get on with my work.
A huge thank you.
Virgile Reignier
"Zimmel, Daniel" D.Zimmel@esvmedien.de a écrit :
While this may not solve your problem, I can confirm that your files import just fine with BaseX 10.3 GUI on my Windows machine. There is a checkbox in the import dialog "Use XInclude", but it works regardless whether the I check or uncheck the box.
-----Ursprüngliche Nachricht----- Von: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de Im Auftrag von Virgile Reignier Gesendet: Dienstag, 14. März 2023 18:55 An: basex-talk@mailman.uni-konstanz.de Betreff: [basex-talk] Problem with using XInclude in BaseX
Bonjour,
Je me permets de vous contacter dans le cadre de mon doctorat en histoire médiévale. Je souhaiterai en effet organiser le dépouillement de mes archives à l'aide d'une base de données en XML en utilisant le logiciel BaseX, mais je suis face à une difficulté que je n'arrive pas à surmonter dans son utilisation. Cette difficulté est liée à l'utilisation de la balise xi:include.
J'ai tenté de produire un exemple minimaliste avec deux fichiers dans un même répertoire pour voir ce qui ne marche pas :
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
Alors que ces deux fichiers sont décrits comme valides par Oxygen, l'importation du fichier music.xml avec BaseX (que ce soit avec l'interface DBA ou l'interface GUI) génère systématiquement l'erreur suivante : "An include with href 'label.xml'failed, and no fallback element was found". Je peux en revanche importer le fichier dans la base de données via Oxygen et l'utilisation du WebDAV de BaseX, mais le fichier est alors indiqué comme étant de type "binary" et est absolument inemployable pour réaliser des requêtes.
J'ai pourtant tenté de réaliser la requête suivante au sein de ma DB dans BaseX GUI, ce qui n'a pas renvoyé d'erreurs :
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
J'ai également tenté de charger ces mêmes fichiers dans eXist DB, et l'inclusion s'est réalisée sans problèmes. Je ne comprends donc pas ce qui ne va pas avec l'utilisation de XInclude dans BaseX. Est-ce qu'il y a un problème avec la résolution des URI ?
Je travaille sous Windows 10 (j'ai aussi fait des tests sur Ubuntu et obtenu le même résultat), BaseX 10.4 et Java 1.8.0_361.
Est-ce que c'est quelque chose qui vous est déjà arrivé ? J'ai essayé de chercher dans les archives mail de basex-talk et trouvé quelques problèmes similaires, mais qui ont été résolus par l'emploi de BaseX GUI. Or chez moi cela marche aussi mal avec GUI qu'avec DBA. Je peux transférer mon travail sur eXist DB, mais j'avoue m'être assez familiarisé avec BaseX et souhaiterai rester sur ce logiciel tant que possible. Je suis donc preneur de toutes vos propositions.
En vous remerciant par avance pour vos réponses,
Bien cordialement,
Virgile Reignier
Hello,
I am contacting you as part of my PhD in medieval history. I would like to organise the analysis of my archives with the help of an XML database using the BaseX software, but I am encountering a difficulty that I cannot overcome in its use. This difficulty is related to the use of the xi:include tag.
I tried to produce a minimalist example with two files in the same directory to see what goes wrong:
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
While both files are described as valid by Oxygen, importing the music.xml file with BaseX (either with the DBA interface or the GUI interface) consistently generates the following error: "An include with href 'label.xml'failed, and no fallback element was found". I can import the file into the database via Oxygen and the use of BaseX WebDAV, but the file is then indicated as being of type "binary" and is absolutely unusable for queries.
However, I tried to perform the following query within my DB in BaseX GUI, which did not return any errors:
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
I also tried to load these same files into eXist DB, and the inclusion was successful. So I don't understand what is wrong with using XInclude in BaseX. Is there a problem with URI resolution?
I'm working on Windows 10 (I also tested on Ubuntu and got the same result), BaseX 10.4 and Java 1.8.0_361.
Is this something that has happened to you before? I tried to search the basex-talk mail archives and found some similar problems, but they were solved by using BaseX GUI. However, in my case it works just as badly with GUI as with DBA. I can transfer my work to eXist DB, but I have become quite familiar with BaseX and would like to stay with it as long as possible. I am therefore interested in any suggestions you may have.
Thank you in advance for your answers,
Virgile Reignier
Bonjour Virgile,
Merci bien pour l’observation. The internal XML parser does not support XInclude, only the standard parser does. I realized this had gone unnoticed in our documentation, and I’ve just revised the corresponding entry [1].
If a new installation of BaseX behaves differently, the contents of your .basex configuration files may differ [2].
Cordialement, Christian
[1] https://docs.basex.org/wiki/Options#INTPARSE [2] https://docs.basex.org/wiki/Configuration
On Wed, Mar 15, 2023 at 10:26 AM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Daniel,
Even if it is indirect, you have solved my problem. As I read you, I quickly reinstalled BaseX to see if the problem could be with version 10.4. And re-importing my database made me pay attention to a little "Use internal XML parser" checkbox in the import dialog. If I check it, everything suddenly starts working properly. I tried again with the 10.4 and it's really this checkbox that makes the difference. I don't realise what impact this might have, but I can get on with my work.
A huge thank you.
Virgile Reignier
"Zimmel, Daniel" D.Zimmel@esvmedien.de a écrit :
While this may not solve your problem, I can confirm that your files import just fine with BaseX 10.3 GUI on my Windows machine. There is a checkbox in the import dialog "Use XInclude", but it works regardless whether the I check or uncheck the box.
-----Ursprüngliche Nachricht----- Von: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de Im Auftrag von Virgile Reignier Gesendet: Dienstag, 14. März 2023 18:55 An: basex-talk@mailman.uni-konstanz.de Betreff: [basex-talk] Problem with using XInclude in BaseX
Bonjour,
Je me permets de vous contacter dans le cadre de mon doctorat en histoire médiévale. Je souhaiterai en effet organiser le dépouillement de mes archives à l'aide d'une base de données en XML en utilisant le logiciel BaseX, mais je suis face à une difficulté que je n'arrive pas à surmonter dans son utilisation. Cette difficulté est liée à l'utilisation de la balise xi:include.
J'ai tenté de produire un exemple minimaliste avec deux fichiers dans un même répertoire pour voir ce qui ne marche pas :
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
Alors que ces deux fichiers sont décrits comme valides par Oxygen, l'importation du fichier music.xml avec BaseX (que ce soit avec l'interface DBA ou l'interface GUI) génère systématiquement l'erreur suivante : "An include with href 'label.xml'failed, and no fallback element was found". Je peux en revanche importer le fichier dans la base de données via Oxygen et l'utilisation du WebDAV de BaseX, mais le fichier est alors indiqué comme étant de type "binary" et est absolument inemployable pour réaliser des requêtes.
J'ai pourtant tenté de réaliser la requête suivante au sein de ma DB dans BaseX GUI, ce qui n'a pas renvoyé d'erreurs :
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
J'ai également tenté de charger ces mêmes fichiers dans eXist DB, et l'inclusion s'est réalisée sans problèmes. Je ne comprends donc pas ce qui ne va pas avec l'utilisation de XInclude dans BaseX. Est-ce qu'il y a un problème avec la résolution des URI ?
Je travaille sous Windows 10 (j'ai aussi fait des tests sur Ubuntu et obtenu le même résultat), BaseX 10.4 et Java 1.8.0_361.
Est-ce que c'est quelque chose qui vous est déjà arrivé ? J'ai essayé de chercher dans les archives mail de basex-talk et trouvé quelques problèmes similaires, mais qui ont été résolus par l'emploi de BaseX GUI. Or chez moi cela marche aussi mal avec GUI qu'avec DBA. Je peux transférer mon travail sur eXist DB, mais j'avoue m'être assez familiarisé avec BaseX et souhaiterai rester sur ce logiciel tant que possible. Je suis donc preneur de toutes vos propositions.
En vous remerciant par avance pour vos réponses,
Bien cordialement,
Virgile Reignier
Hello,
I am contacting you as part of my PhD in medieval history. I would like to organise the analysis of my archives with the help of an XML database using the BaseX software, but I am encountering a difficulty that I cannot overcome in its use. This difficulty is related to the use of the xi:include tag.
I tried to produce a minimalist example with two files in the same directory to see what goes wrong:
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
While both files are described as valid by Oxygen, importing the music.xml file with BaseX (either with the DBA interface or the GUI interface) consistently generates the following error: "An include with href 'label.xml'failed, and no fallback element was found". I can import the file into the database via Oxygen and the use of BaseX WebDAV, but the file is then indicated as being of type "binary" and is absolutely unusable for queries.
However, I tried to perform the following query within my DB in BaseX GUI, which did not return any errors:
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
I also tried to load these same files into eXist DB, and the inclusion was successful. So I don't understand what is wrong with using XInclude in BaseX. Is there a problem with URI resolution?
I'm working on Windows 10 (I also tested on Ubuntu and got the same result), BaseX 10.4 and Java 1.8.0_361.
Is this something that has happened to you before? I tried to search the basex-talk mail archives and found some similar problems, but they were solved by using BaseX GUI. However, in my case it works just as badly with GUI as with DBA. I can transfer my work to eXist DB, but I have become quite familiar with BaseX and would like to stay with it as long as possible. I am therefore interested in any suggestions you may have.
Thank you in advance for your answers,
Virgile Reignier
Bonjour Christian,
Thank you for this explanation. If I understand correctly, using the Internal XML parser does not generate an error only because it does not process XInclude and keeps the files as is. This is only partially convenient for me: I can at least generate my files, manipulate them and export them but I don't take full advantage of the possibilities allowed by XInclude. Do you know if it is possible to do something about this? Is this something that depends on the functionality of BaseX?
Thanks in advance
Bien cordialement,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Bonjour Virgile,
Merci bien pour l’observation. The internal XML parser does not support XInclude, only the standard parser does. I realized this had gone unnoticed in our documentation, and I’ve just revised the corresponding entry [1].
If a new installation of BaseX behaves differently, the contents of your .basex configuration files may differ [2].
Cordialement, Christian
[1] https://docs.basex.org/wiki/Options#INTPARSE [2] https://docs.basex.org/wiki/Configuration
On Wed, Mar 15, 2023 at 10:26 AM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Daniel,
Even if it is indirect, you have solved my problem. As I read you, I quickly reinstalled BaseX to see if the problem could be with version 10.4. And re-importing my database made me pay attention to a little "Use internal XML parser" checkbox in the import dialog. If I check it, everything suddenly starts working properly. I tried again with the 10.4 and it's really this checkbox that makes the difference. I don't realise what impact this might have, but I can get on with my work.
A huge thank you.
Virgile Reignier
"Zimmel, Daniel" D.Zimmel@esvmedien.de a écrit :
While this may not solve your problem, I can confirm that your files import just fine with BaseX 10.3 GUI on my Windows machine. There is a checkbox in the import dialog "Use XInclude", but it works regardless whether the I check or uncheck the box.
-----Ursprüngliche Nachricht----- Von: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de Im Auftrag von Virgile Reignier Gesendet: Dienstag, 14. März 2023 18:55 An: basex-talk@mailman.uni-konstanz.de Betreff: [basex-talk] Problem with using XInclude in BaseX
Bonjour,
Je me permets de vous contacter dans le cadre de mon doctorat en histoire médiévale. Je souhaiterai en effet organiser le dépouillement de mes archives à l'aide d'une base de données en XML en utilisant le logiciel BaseX, mais je suis face à une difficulté que je n'arrive pas à surmonter dans son utilisation. Cette difficulté est liée à l'utilisation de la balise xi:include.
J'ai tenté de produire un exemple minimaliste avec deux fichiers dans un même répertoire pour voir ce qui ne marche pas :
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
Alors que ces deux fichiers sont décrits comme valides par Oxygen, l'importation du fichier music.xml avec BaseX (que ce soit avec l'interface DBA ou l'interface GUI) génère systématiquement l'erreur suivante : "An include with href 'label.xml'failed, and no fallback element was found". Je peux en revanche importer le fichier dans la base de données via Oxygen et l'utilisation du WebDAV de BaseX, mais le fichier est alors indiqué comme étant de type "binary" et est absolument inemployable pour réaliser des requêtes.
J'ai pourtant tenté de réaliser la requête suivante au sein de ma DB dans BaseX GUI, ce qui n'a pas renvoyé d'erreurs :
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
J'ai également tenté de charger ces mêmes fichiers dans eXist DB, et l'inclusion s'est réalisée sans problèmes. Je ne comprends donc pas ce qui ne va pas avec l'utilisation de XInclude dans BaseX. Est-ce qu'il y a un problème avec la résolution des URI ?
Je travaille sous Windows 10 (j'ai aussi fait des tests sur Ubuntu et obtenu le même résultat), BaseX 10.4 et Java 1.8.0_361.
Est-ce que c'est quelque chose qui vous est déjà arrivé ? J'ai essayé de chercher dans les archives mail de basex-talk et trouvé quelques problèmes similaires, mais qui ont été résolus par l'emploi de BaseX GUI. Or chez moi cela marche aussi mal avec GUI qu'avec DBA. Je peux transférer mon travail sur eXist DB, mais j'avoue m'être assez familiarisé avec BaseX et souhaiterai rester sur ce logiciel tant que possible. Je suis donc preneur de toutes vos propositions.
En vous remerciant par avance pour vos réponses,
Bien cordialement,
Virgile Reignier
Hello,
I am contacting you as part of my PhD in medieval history. I would like to organise the analysis of my archives with the help of an XML database using the BaseX software, but I am encountering a difficulty that I cannot overcome in its use. This difficulty is related to the use of the xi:include tag.
I tried to produce a minimalist example with two files in the same directory to see what goes wrong:
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
While both files are described as valid by Oxygen, importing the music.xml file with BaseX (either with the DBA interface or the GUI interface) consistently generates the following error: "An include with href 'label.xml'failed, and no fallback element was found". I can import the file into the database via Oxygen and the use of BaseX WebDAV, but the file is then indicated as being of type "binary" and is absolutely unusable for queries.
However, I tried to perform the following query within my DB in BaseX GUI, which did not return any errors:
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
I also tried to load these same files into eXist DB, and the inclusion was successful. So I don't understand what is wrong with using XInclude in BaseX. Is there a problem with URI resolution?
I'm working on Windows 10 (I also tested on Ubuntu and got the same result), BaseX 10.4 and Java 1.8.0_361.
Is this something that has happened to you before? I tried to search the basex-talk mail archives and found some similar problems, but they were solved by using BaseX GUI. However, in my case it works just as badly with GUI as with DBA. I can transfer my work to eXist DB, but I have become quite familiar with BaseX and would like to stay with it as long as possible. I am therefore interested in any suggestions you may have.
Thank you in advance for your answers,
Virgile Reignier
Hi Virgile,
I think the best solution for you will be to use the default XML parser, which is by default enabled.
Only if you enable the internal parser (by selecting it in the GUI or setting INTPARSE to true), XInclude will not be supported.
Hope this helps? Christian
Thank you for this explanation. If I understand correctly, using the Internal XML parser does not generate an error only because it does not process XInclude and keeps the files as is. This is only partially convenient for me: I can at least generate my files, manipulate them and export them but I don't take full advantage of the possibilities allowed by XInclude. Do you know if it is possible to do something about this? Is this something that depends on the functionality of BaseX?
Thanks in advance
Bien cordialement,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Bonjour Virgile,
Merci bien pour l’observation. The internal XML parser does not support XInclude, only the standard parser does. I realized this had gone unnoticed in our documentation, and I’ve just revised the corresponding entry [1].
If a new installation of BaseX behaves differently, the contents of your .basex configuration files may differ [2].
Cordialement, Christian
[1] https://docs.basex.org/wiki/Options#INTPARSE [2] https://docs.basex.org/wiki/Configuration
On Wed, Mar 15, 2023 at 10:26 AM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Daniel,
Even if it is indirect, you have solved my problem. As I read you, I quickly reinstalled BaseX to see if the problem could be with version 10.4. And re-importing my database made me pay attention to a little "Use internal XML parser" checkbox in the import dialog. If I check it, everything suddenly starts working properly. I tried again with the 10.4 and it's really this checkbox that makes the difference. I don't realise what impact this might have, but I can get on with my work.
A huge thank you.
Virgile Reignier
"Zimmel, Daniel" D.Zimmel@esvmedien.de a écrit :
While this may not solve your problem, I can confirm that your files import just fine with BaseX 10.3 GUI on my Windows machine. There is a checkbox in the import dialog "Use XInclude", but it works regardless whether the I check or uncheck the box.
-----Ursprüngliche Nachricht----- Von: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de Im Auftrag von Virgile Reignier Gesendet: Dienstag, 14. März 2023 18:55 An: basex-talk@mailman.uni-konstanz.de Betreff: [basex-talk] Problem with using XInclude in BaseX
Bonjour,
Je me permets de vous contacter dans le cadre de mon doctorat en histoire médiévale. Je souhaiterai en effet organiser le dépouillement de mes archives à l'aide d'une base de données en XML en utilisant le logiciel BaseX, mais je suis face à une difficulté que je n'arrive pas à surmonter dans son utilisation. Cette difficulté est liée à l'utilisation de la balise xi:include.
J'ai tenté de produire un exemple minimaliste avec deux fichiers dans un même répertoire pour voir ce qui ne marche pas :
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
Alors que ces deux fichiers sont décrits comme valides par Oxygen, l'importation du fichier music.xml avec BaseX (que ce soit avec l'interface DBA ou l'interface GUI) génère systématiquement l'erreur suivante : "An include with href 'label.xml'failed, and no fallback element was found". Je peux en revanche importer le fichier dans la base de données via Oxygen et l'utilisation du WebDAV de BaseX, mais le fichier est alors indiqué comme étant de type "binary" et est absolument inemployable pour réaliser des requêtes.
J'ai pourtant tenté de réaliser la requête suivante au sein de ma DB dans BaseX GUI, ce qui n'a pas renvoyé d'erreurs :
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
J'ai également tenté de charger ces mêmes fichiers dans eXist DB, et l'inclusion s'est réalisée sans problèmes. Je ne comprends donc pas ce qui ne va pas avec l'utilisation de XInclude dans BaseX. Est-ce qu'il y a un problème avec la résolution des URI ?
Je travaille sous Windows 10 (j'ai aussi fait des tests sur Ubuntu et obtenu le même résultat), BaseX 10.4 et Java 1.8.0_361.
Est-ce que c'est quelque chose qui vous est déjà arrivé ? J'ai essayé de chercher dans les archives mail de basex-talk et trouvé quelques problèmes similaires, mais qui ont été résolus par l'emploi de BaseX GUI. Or chez moi cela marche aussi mal avec GUI qu'avec DBA. Je peux transférer mon travail sur eXist DB, mais j'avoue m'être assez familiarisé avec BaseX et souhaiterai rester sur ce logiciel tant que possible. Je suis donc preneur de toutes vos propositions.
En vous remerciant par avance pour vos réponses,
Bien cordialement,
Virgile Reignier
Hello,
I am contacting you as part of my PhD in medieval history. I would like to organise the analysis of my archives with the help of an XML database using the BaseX software, but I am encountering a difficulty that I cannot overcome in its use. This difficulty is related to the use of the xi:include tag.
I tried to produce a minimalist example with two files in the same directory to see what goes wrong:
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
While both files are described as valid by Oxygen, importing the music.xml file with BaseX (either with the DBA interface or the GUI interface) consistently generates the following error: "An include with href 'label.xml'failed, and no fallback element was found". I can import the file into the database via Oxygen and the use of BaseX WebDAV, but the file is then indicated as being of type "binary" and is absolutely unusable for queries.
However, I tried to perform the following query within my DB in BaseX GUI, which did not return any errors:
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
I also tried to load these same files into eXist DB, and the inclusion was successful. So I don't understand what is wrong with using XInclude in BaseX. Is there a problem with URI resolution?
I'm working on Windows 10 (I also tested on Ubuntu and got the same result), BaseX 10.4 and Java 1.8.0_361.
Is this something that has happened to you before? I tried to search the basex-talk mail archives and found some similar problems, but they were solved by using BaseX GUI. However, in my case it works just as badly with GUI as with DBA. I can transfer my work to eXist DB, but I have become quite familiar with BaseX and would like to stay with it as long as possible. I am therefore interested in any suggestions you may have.
Thank you in advance for your answers,
Virgile Reignier
Hi Christian,
That would be the best thing indeed, but that's where the error is that was the subject of my first email. For some reason I can't figure out, the default XML parser crashes every time it tries to include an xi:include tag. However the same files are valid for Oxygen and even for eXist db...
Do you have any idea what could be causing this?
Regards,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Hi Virgile,
I think the best solution for you will be to use the default XML parser, which is by default enabled.
Only if you enable the internal parser (by selecting it in the GUI or setting INTPARSE to true), XInclude will not be supported.
Hope this helps? Christian
Thank you for this explanation. If I understand correctly, using the Internal XML parser does not generate an error only because it does not process XInclude and keeps the files as is. This is only partially convenient for me: I can at least generate my files, manipulate them and export them but I don't take full advantage of the possibilities allowed by XInclude. Do you know if it is possible to do something about this? Is this something that depends on the functionality of BaseX?
Thanks in advance
Bien cordialement,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Bonjour Virgile,
Merci bien pour l’observation. The internal XML parser does not support XInclude, only the standard parser does. I realized this had gone unnoticed in our documentation, and I’ve just revised the corresponding entry [1].
If a new installation of BaseX behaves differently, the contents of your .basex configuration files may differ [2].
Cordialement, Christian
[1] https://docs.basex.org/wiki/Options#INTPARSE [2] https://docs.basex.org/wiki/Configuration
On Wed, Mar 15, 2023 at 10:26 AM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Daniel,
Even if it is indirect, you have solved my problem. As I read you, I quickly reinstalled BaseX to see if the problem could be with version 10.4. And re-importing my database made me pay attention to a little "Use internal XML parser" checkbox in the import dialog. If I check it, everything suddenly starts working properly. I tried again with the 10.4 and it's really this checkbox that makes the difference. I don't realise what impact this might have, but I can get on with my work.
A huge thank you.
Virgile Reignier
"Zimmel, Daniel" D.Zimmel@esvmedien.de a écrit :
While this may not solve your problem, I can confirm that your files import just fine with BaseX 10.3 GUI on my Windows machine. There is a checkbox in the import dialog "Use XInclude", but it works regardless whether the I check or uncheck the box.
-----Ursprüngliche Nachricht----- Von: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de Im Auftrag von Virgile Reignier Gesendet: Dienstag, 14. März 2023 18:55 An: basex-talk@mailman.uni-konstanz.de Betreff: [basex-talk] Problem with using XInclude in BaseX
Bonjour,
Je me permets de vous contacter dans le cadre de mon doctorat en histoire médiévale. Je souhaiterai en effet organiser le dépouillement de mes archives à l'aide d'une base de données en XML en utilisant le logiciel BaseX, mais je suis face à une difficulté que je n'arrive pas à surmonter dans son utilisation. Cette difficulté est liée à l'utilisation de la balise xi:include.
J'ai tenté de produire un exemple minimaliste avec deux fichiers dans un même répertoire pour voir ce qui ne marche pas :
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
Alors que ces deux fichiers sont décrits comme valides par Oxygen, l'importation du fichier music.xml avec BaseX (que ce soit avec l'interface DBA ou l'interface GUI) génère systématiquement l'erreur suivante : "An include with href 'label.xml'failed, and no fallback element was found". Je peux en revanche importer le fichier dans la base de données via Oxygen et l'utilisation du WebDAV de BaseX, mais le fichier est alors indiqué comme étant de type "binary" et est absolument inemployable pour réaliser des requêtes.
J'ai pourtant tenté de réaliser la requête suivante au sein de ma DB dans BaseX GUI, ce qui n'a pas renvoyé d'erreurs :
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
J'ai également tenté de charger ces mêmes fichiers dans eXist DB, et l'inclusion s'est réalisée sans problèmes. Je ne comprends donc pas ce qui ne va pas avec l'utilisation de XInclude dans BaseX. Est-ce qu'il y a un problème avec la résolution des URI ?
Je travaille sous Windows 10 (j'ai aussi fait des tests sur Ubuntu et obtenu le même résultat), BaseX 10.4 et Java 1.8.0_361.
Est-ce que c'est quelque chose qui vous est déjà arrivé ? J'ai essayé de chercher dans les archives mail de basex-talk et trouvé quelques problèmes similaires, mais qui ont été résolus par l'emploi de BaseX GUI. Or chez moi cela marche aussi mal avec GUI qu'avec DBA. Je peux transférer mon travail sur eXist DB, mais j'avoue m'être assez familiarisé avec BaseX et souhaiterai rester sur ce logiciel tant que possible. Je suis donc preneur de toutes vos propositions.
En vous remerciant par avance pour vos réponses,
Bien cordialement,
Virgile Reignier
Hello,
I am contacting you as part of my PhD in medieval history. I would like to organise the analysis of my archives with the help of an XML database using the BaseX software, but I am encountering a difficulty that I cannot overcome in its use. This difficulty is related to the use of the xi:include tag.
I tried to produce a minimalist example with two files in the same directory to see what goes wrong:
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
While both files are described as valid by Oxygen, importing the music.xml file with BaseX (either with the DBA interface or the GUI interface) consistently generates the following error: "An include with href 'label.xml'failed, and no fallback element was found". I can import the file into the database via Oxygen and the use of BaseX WebDAV, but the file is then indicated as being of type "binary" and is absolutely unusable for queries.
However, I tried to perform the following query within my DB in BaseX GUI, which did not return any errors:
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
I also tried to load these same files into eXist DB, and the inclusion was successful. So I don't understand what is wrong with using XInclude in BaseX. Is there a problem with URI resolution?
I'm working on Windows 10 (I also tested on Ubuntu and got the same result), BaseX 10.4 and Java 1.8.0_361.
Is this something that has happened to you before? I tried to search the basex-talk mail archives and found some similar problems, but they were solved by using BaseX GUI. However, in my case it works just as badly with GUI as with DBA. I can transfer my work to eXist DB, but I have become quite familiar with BaseX and would like to stay with it as long as possible. I am therefore interested in any suggestions you may have.
Thank you in advance for your answers,
Virgile Reignier
Hi Virgilie,
Similar to Daniel, I'm not sure how to reproduce the problem. Could you possibly give us a step-by-step description on how you proceed?
What do you mean by “the default XML parser crashes”, what happens exactly?
Merci par avance, Christian
Virgile Reignier virgile.reignier@u-picardie.fr schrieb am Fr., 17. März 2023, 14:33:
Hi Christian,
That would be the best thing indeed, but that's where the error is that was the subject of my first email. For some reason I can't figure out, the default XML parser crashes every time it tries to include an xi:include tag. However the same files are valid for Oxygen and even for eXist db...
Do you have any idea what could be causing this?
Regards,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Hi Virgile,
I think the best solution for you will be to use the default XML parser, which is by default enabled.
Only if you enable the internal parser (by selecting it in the GUI or setting INTPARSE to true), XInclude will not be supported.
Hope this helps? Christian
Thank you for this explanation. If I understand correctly, using the Internal XML parser does not generate an error only because it does not process XInclude and keeps the files as is. This is only partially convenient for me: I can at least generate my files, manipulate them and export them but I don't take full advantage of the possibilities allowed by XInclude. Do you know if it is possible to do something about this? Is this something that depends on the functionality of BaseX?
Thanks in advance
Bien cordialement,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Bonjour Virgile,
Merci bien pour l’observation. The internal XML parser does not support XInclude, only the standard parser does. I realized this had gone unnoticed in our documentation, and I’ve just revised the corresponding entry [1].
If a new installation of BaseX behaves differently, the contents of your .basex configuration files may differ [2].
Cordialement, Christian
[1] https://docs.basex.org/wiki/Options#INTPARSE [2] https://docs.basex.org/wiki/Configuration
On Wed, Mar 15, 2023 at 10:26 AM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Daniel,
Even if it is indirect, you have solved my problem. As I read you, I quickly reinstalled BaseX to see if the problem could be with version 10.4. And re-importing my database made me pay attention to a little "Use internal XML parser" checkbox in the import dialog. If I check it, everything suddenly starts working properly. I tried again with the 10.4 and it's really this checkbox that makes the difference. I don't realise what impact this might have, but I can get on with my work.
A huge thank you.
Virgile Reignier
"Zimmel, Daniel" D.Zimmel@esvmedien.de a écrit :
While this may not solve your problem, I can confirm that your
files
import just fine with BaseX 10.3 GUI on my Windows machine. There is a checkbox in the import dialog "Use XInclude", but it works regardless whether the I check or uncheck the box.
-----Ursprüngliche Nachricht----- Von: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de Im Auftrag von Virgile Reignier Gesendet: Dienstag, 14. März 2023 18:55 An: basex-talk@mailman.uni-konstanz.de Betreff: [basex-talk] Problem with using XInclude in BaseX
Bonjour,
Je me permets de vous contacter dans le cadre de mon doctorat en histoire médiévale. Je souhaiterai en effet organiser le dépouillement de mes archives à l'aide d'une base de données en XML en utilisant le logiciel BaseX, mais je suis face à une difficulté que je n'arrive pas à surmonter dans son utilisation. Cette difficulté est liée à l'utilisation de la balise xi:include.
J'ai tenté de produire un exemple minimaliste avec deux fichiers dans un même répertoire pour voir ce qui ne marche pas :
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
Alors que ces deux fichiers sont décrits comme valides par Oxygen, l'importation du fichier music.xml avec BaseX (que ce soit avec l'interface DBA ou l'interface GUI) génère systématiquement
l'erreur
suivante : "An include with href 'label.xml'failed, and no fallback element was found". Je peux en revanche importer le fichier dans la base de données via Oxygen et l'utilisation du WebDAV de BaseX,
mais
le fichier est alors indiqué comme étant de type "binary" et est absolument inemployable pour réaliser des requêtes.
J'ai pourtant tenté de réaliser la requête suivante au sein de ma
DB
dans BaseX GUI, ce qui n'a pas renvoyé d'erreurs :
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
J'ai également tenté de charger ces mêmes fichiers dans eXist DB,
et
l'inclusion s'est réalisée sans problèmes. Je ne comprends donc pas ce qui ne va pas avec l'utilisation de XInclude dans BaseX. Est-ce qu'il y a un problème avec la résolution des URI ?
Je travaille sous Windows 10 (j'ai aussi fait des tests sur Ubuntu et obtenu le même résultat), BaseX 10.4 et Java 1.8.0_361.
Est-ce que c'est quelque chose qui vous est déjà arrivé ? J'ai essayé de chercher dans les archives mail de basex-talk et trouvé quelques problèmes similaires, mais qui ont été résolus par
l'emploi
de BaseX GUI. Or chez moi cela marche aussi mal avec GUI qu'avec DBA. Je peux transférer mon travail sur eXist DB, mais j'avoue m'être assez familiarisé avec BaseX et souhaiterai rester sur ce logiciel tant que possible. Je suis donc preneur de toutes vos propositions.
En vous remerciant par avance pour vos réponses,
Bien cordialement,
Virgile Reignier
Hello,
I am contacting you as part of my PhD in medieval history. I would like to organise the analysis of my archives with the help of an
XML
database using the BaseX software, but I am encountering a difficulty that I cannot overcome in its use. This difficulty is related to the use of the xi:include tag.
I tried to produce a minimalist example with two files in the same directory to see what goes wrong:
file music.xml :
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <xi:include href="label.xml"/> </musique>
file label.xml :
<label>Purple Records</label>
While both files are described as valid by Oxygen, importing the music.xml file with BaseX (either with the DBA interface or the GUI interface) consistently generates the following error: "An include with href 'label.xml'failed, and no fallback element was found". I can import the file into the database via Oxygen and the use of BaseX WebDAV, but the file is then indicated as being of type "binary" and is absolutely unusable for queries.
However, I tried to perform the following query within my DB in BaseX GUI, which did not return any errors:
declare namespace xi = "http://www.w3.org/2001/XInclude";
xi:include
I also tried to load these same files into eXist DB, and the inclusion was successful. So I don't understand what is wrong with using XInclude in BaseX. Is there a problem with URI resolution?
I'm working on Windows 10 (I also tested on Ubuntu and got the same result), BaseX 10.4 and Java 1.8.0_361.
Is this something that has happened to you before? I tried to
search
the basex-talk mail archives and found some similar problems, but they were solved by using BaseX GUI. However, in my case it works just as badly with GUI as with DBA. I can transfer my work to eXist DB, but I have become quite familiar with BaseX and would like to stay with it as long as possible. I am therefore interested in any suggestions you may have.
Thank you in advance for your answers,
Virgile Reignier
Hi Daniel,
Actually it's hard to describe because I don't have a detailed error message to go on. The only thing I understand is that the default parser used by BaseX does not know how to use XInclude.
This manifests itself in two ways: when I import a file that includes an XInclude, the interface displays the following error: "An include with href 'label.xml'failed, and no fallback element was found" if I take the example I presented in my first email. And if I modify a file in my database to add an XInclude tag with another interface such as Oxygen, the file is transformed into a binary format and becomes impossible to manipulate by BaseX.
If it works on your side, it should logically works on mine, but even with a second computer I have at my disposal it causes exactly the same thing.
Maybe BaseX uses a software support that needs to be put in a specific version? Thank you for your help and I am at your disposal if any other indications or tests can help you to better understand the situation. From my side, it's as if I'm swimming.
Bien cordialement,
Virgile
Christian Grün christian.gruen@gmail.com a écrit :
Hi Virgilie,
Similar to Daniel, I'm not sure how to reproduce the problem. Could you possibly give us a step-by-step description on how you proceed?
What do you mean by “the default XML parser crashes”, what happens exactly?
Merci par avance, Christian
Virgile Reignier virgile.reignier@u-picardie.fr schrieb am Fr., 17. März 2023, 14:33:
Hi Christian,
That would be the best thing indeed, but that's where the error is that was the subject of my first email. For some reason I can't figure out, the default XML parser crashes every time it tries to include an xi:include tag. However the same files are valid for Oxygen and even for eXist db...
Do you have any idea what could be causing this?
Regards,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Hi Virgile,
I think the best solution for you will be to use the default XML parser, which is by default enabled.
Only if you enable the internal parser (by selecting it in the GUI or setting INTPARSE to true), XInclude will not be supported.
Hope this helps? Christian
Thank you for this explanation. If I understand correctly, using the Internal XML parser does not generate an error only because it does not process XInclude and keeps the files as is. This is only partially convenient for me: I can at least generate my files, manipulate them and export them but I don't take full advantage of the possibilities allowed by XInclude. Do you know if it is possible to do something about this? Is this something that depends on the functionality of BaseX?
Thanks in advance
Bien cordialement,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Bonjour Virgile,
Merci bien pour l’observation. The internal XML parser does not support XInclude, only the standard parser does. I realized this had gone unnoticed in our documentation, and I’ve just revised the corresponding entry [1].
If a new installation of BaseX behaves differently, the contents of your .basex configuration files may differ [2].
Cordialement, Christian
[1] https://docs.basex.org/wiki/Options#INTPARSE [2] https://docs.basex.org/wiki/Configuration
On Wed, Mar 15, 2023 at 10:26 AM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Daniel,
Even if it is indirect, you have solved my problem. As I read you, I quickly reinstalled BaseX to see if the problem could be with version 10.4. And re-importing my database made me pay attention to a little "Use internal XML parser" checkbox in the import dialog. If I check it, everything suddenly starts working properly. I tried again with the 10.4 and it's really this checkbox that makes the difference. I don't realise what impact this might have, but I can get on with my work.
A huge thank you.
Virgile Reignier
"Zimmel, Daniel" D.Zimmel@esvmedien.de a écrit :
> While this may not solve your problem, I can confirm that your
files
> import just fine with BaseX 10.3 GUI on my Windows machine. > There is a checkbox in the import dialog "Use XInclude", but it > works regardless whether the I check or uncheck the box. > > -----Ursprüngliche Nachricht----- > Von: BaseX-Talk basex-talk-bounces@mailman.uni-konstanz.de Im > Auftrag von Virgile Reignier > Gesendet: Dienstag, 14. März 2023 18:55 > An: basex-talk@mailman.uni-konstanz.de > Betreff: [basex-talk] Problem with using XInclude in BaseX > > Bonjour, > > Je me permets de vous contacter dans le cadre de mon doctorat en > histoire médiévale. Je souhaiterai en effet organiser le > dépouillement de mes archives à l'aide d'une base de données en XML > en utilisant le logiciel BaseX, mais je suis face à une difficulté > que je n'arrive pas à surmonter dans son utilisation. Cette > difficulté est liée à l'utilisation de la balise xi:include. > > J'ai tenté de produire un exemple minimaliste avec deux fichiers > dans un même répertoire pour voir ce qui ne marche pas : > > file music.xml : > > <musique xmlns:xi="http://www.w3.org/2001/XInclude"> > <titre>Smoke on the water</titre> > <artiste>Deep Purple</artiste> > <xi:include href="label.xml"/> > </musique> > > file label.xml : > > <label>Purple Records</label> > > Alors que ces deux fichiers sont décrits comme valides par Oxygen, > l'importation du fichier music.xml avec BaseX (que ce soit avec > l'interface DBA ou l'interface GUI) génère systématiquement
l'erreur
> suivante : "An include with href 'label.xml'failed, and no fallback > element was found". Je peux en revanche importer le fichier dans la > base de données via Oxygen et l'utilisation du WebDAV de BaseX,
mais
> le fichier est alors indiqué comme étant de type "binary" et est > absolument inemployable pour réaliser des requêtes. > > J'ai pourtant tenté de réaliser la requête suivante au sein de ma
DB
> dans BaseX GUI, ce qui n'a pas renvoyé d'erreurs : > > declare namespace xi = "http://www.w3.org/2001/XInclude"; > > xi:include > > J'ai également tenté de charger ces mêmes fichiers dans eXist DB,
et
> l'inclusion s'est réalisée sans problèmes. Je ne comprends donc pas > ce qui ne va pas avec l'utilisation de XInclude dans BaseX. Est-ce > qu'il y a un problème avec la résolution des URI ? > > Je travaille sous Windows 10 (j'ai aussi fait des tests sur Ubuntu > et obtenu le même résultat), BaseX 10.4 et Java 1.8.0_361. > > Est-ce que c'est quelque chose qui vous est déjà arrivé ? J'ai > essayé de chercher dans les archives mail de basex-talk et trouvé > quelques problèmes similaires, mais qui ont été résolus par
l'emploi
> de BaseX GUI. Or chez moi cela marche aussi mal avec GUI qu'avec > DBA. Je peux transférer mon travail sur eXist DB, mais j'avoue > m'être assez familiarisé avec BaseX et souhaiterai rester sur ce > logiciel tant que possible. Je suis donc preneur de toutes vos > propositions. > > En vous remerciant par avance pour vos réponses, > > Bien cordialement, > > Virgile Reignier > > Hello, > > I am contacting you as part of my PhD in medieval history. I would > like to organise the analysis of my archives with the help of an
XML
> database using the BaseX software, but I am encountering a > difficulty that I cannot overcome in its use. This difficulty is > related to the use of the xi:include tag. > > I tried to produce a minimalist example with two files in the same > directory to see what goes wrong: > > file music.xml : > > <musique xmlns:xi="http://www.w3.org/2001/XInclude"> > <titre>Smoke on the water</titre> > <artiste>Deep Purple</artiste> > <xi:include href="label.xml"/> > </musique> > > file label.xml : > > <label>Purple Records</label> > > While both files are described as valid by Oxygen, importing the > music.xml file with BaseX (either with the DBA interface or the GUI > interface) consistently generates the following error: "An include > with href 'label.xml'failed, and no fallback element was found". I > can import the file into the database via Oxygen and the use of > BaseX WebDAV, but the file is then indicated as being of type > "binary" and is absolutely unusable for queries. > > However, I tried to perform the following query within my DB in > BaseX GUI, which did not return any errors: > > declare namespace xi = "http://www.w3.org/2001/XInclude"; > > xi:include > > I also tried to load these same files into eXist DB, and the > inclusion was successful. So I don't understand what is wrong with > using XInclude in BaseX. Is there a problem with URI resolution? > > I'm working on Windows 10 (I also tested on Ubuntu and got the same > result), BaseX 10.4 and Java 1.8.0_361. > > Is this something that has happened to you before? I tried to
search
> the basex-talk mail archives and found some similar problems, but > they were solved by using BaseX GUI. However, in my case it works > just as badly with GUI as with DBA. I can transfer my work to eXist > DB, but I have become quite familiar with BaseX and would like to > stay with it as long as possible. I am therefore interested in any > suggestions you may have. > > Thank you in advance for your answers, > > Virgile Reignier
Maybe we can turn it around: I’ll give you a step-by-step explanation of what I did, and I would be interested if it works for you:
1. choose a local directory 2. copy music.xml and label.xml into that directory 3. download and unzip BaseX.zip into that directory [1] 4. go to the command line and type in:
basex\bin\basex -d -c "create db test music.xml" -q.
This is what is returned on my command-line:
Creating Database... . 129.25 ms (16 MB) Indexing Text... . 0.0 M operations, 4.89 ms (19 MB). Indexing Attribute Values... . 0.0 M operations, 2.53 ms (19 MB). <musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <label xml:base="label.xml">Purple Records</label> </musique>
Could you please pass on your output such that we can compare it?
With -d, debugging is enabled (which might give us some hints on what goes wrong on your machine). With "-q.", the contents of the created database will be returned.
If you use Linux or macOS, you’ll need to replace the backslash characters with slashes.
Which operating system and which Java version and distribution do you use?
Best, Christian
[1] https://files.basex.org/releases/10.4/BaseX104.zip
On Fri, Mar 17, 2023 at 3:21 PM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Daniel,
Actually it's hard to describe because I don't have a detailed error message to go on. The only thing I understand is that the default parser used by BaseX does not know how to use XInclude.
This manifests itself in two ways: when I import a file that includes an XInclude, the interface displays the following error: "An include with href 'label.xml'failed, and no fallback element was found" if I take the example I presented in my first email. And if I modify a file in my database to add an XInclude tag with another interface such as Oxygen, the file is transformed into a binary format and becomes impossible to manipulate by BaseX.
If it works on your side, it should logically works on mine, but even with a second computer I have at my disposal it causes exactly the same thing.
Maybe BaseX uses a software support that needs to be put in a specific version? Thank you for your help and I am at your disposal if any other indications or tests can help you to better understand the situation. From my side, it's as if I'm swimming.
Bien cordialement,
Virgile
Hi Christian,
Thank you very much for your help. In fact I was facing two problems that generated the same error and each of my attempts only solved at most one of the two. Thanks for your advice: the proposed test works very well and allowed me to compare step by step the differences with my files.
The two errors I found are :
1 - The presence of special characters such as the French "è" in the file path. For some reason this does not bother Oxygen or eXist, only BaseX. 2 - the use of the xpointer attribute in the xi:included tag, which systematically generates an error.
Thank you very much for helping me to reach these conclusions, which has allowed me to make a lot of progress:
1 - The problem is easy to solve: I just need to remove all traces of unconventionality from my file names (simple but it was necessary to think about it) 2 - I can put the items I want to include in the root of my file and avoid using the xpointer attribute. The only disadvantage of this is that my file is no longer valid with respect to the TEI and I can no longer take advantage of this scheme to organise their metadata. This won't stop me from working, but I'd like to take this opportunity to ask you if you also have an error when you use xpointer in your files? Is it simply a feature that BaseX does not support?
If necessary, here are the two files I use as a test for this purpose:
music.xml :
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml" xpointer="purple"/> </music>
label.xml:
<list><label xml:id="purple">Purple Records</label></list>
Again, Oxygen tells me for its part that everything is valid, and the tests with eXist included the xpointer feature. And if I remove the xpointer attribute, I have no errors in sight.
If needed, I work with Java version 11, Windows 10 and BaseX 10.4
Thanks again for everything,
Regards,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Maybe we can turn it around: I’ll give you a step-by-step explanation of what I did, and I would be interested if it works for you:
- choose a local directory
- copy music.xml and label.xml into that directory
- download and unzip BaseX.zip into that directory [1]
- go to the command line and type in:
basex\bin\basex -d -c "create db test music.xml" -q.
This is what is returned on my command-line:
Creating Database... . 129.25 ms (16 MB) Indexing Text... . 0.0 M operations, 4.89 ms (19 MB). Indexing Attribute Values... . 0.0 M operations, 2.53 ms (19 MB).
<musique xmlns:xi="http://www.w3.org/2001/XInclude"> <titre>Smoke on the water</titre> <artiste>Deep Purple</artiste> <label xml:base="label.xml">Purple Records</label> </musique>
Could you please pass on your output such that we can compare it?
With -d, debugging is enabled (which might give us some hints on what goes wrong on your machine). With "-q.", the contents of the created database will be returned.
If you use Linux or macOS, you’ll need to replace the backslash characters with slashes.
Which operating system and which Java version and distribution do you use?
Best, Christian
[1] https://files.basex.org/releases/10.4/BaseX104.zip
On Fri, Mar 17, 2023 at 3:21 PM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Daniel,
Actually it's hard to describe because I don't have a detailed error message to go on. The only thing I understand is that the default parser used by BaseX does not know how to use XInclude.
This manifests itself in two ways: when I import a file that includes an XInclude, the interface displays the following error: "An include with href 'label.xml'failed, and no fallback element was found" if I take the example I presented in my first email. And if I modify a file in my database to add an XInclude tag with another interface such as Oxygen, the file is transformed into a binary format and becomes impossible to manipulate by BaseX.
If it works on your side, it should logically works on mine, but even with a second computer I have at my disposal it causes exactly the same thing.
Maybe BaseX uses a software support that needs to be put in a specific version? Thank you for your help and I am at your disposal if any other indications or tests can help you to better understand the situation. From my side, it's as if I'm swimming.
Bien cordialement,
Virgile
Hi Virgile,
Thanks for giving us an update.
2 - the use of the xpointer attribute in the xi:included tag, which systematically generates an error.
I see. Sorry for that. BaseX relies on the standard JDK library for parsing XML documents. Unfortunately, XPointer is only partially supported. It’s interesting to hear, though, that XPointer seems to be fully supported by eXist-db. I remember that other users reported problems with xpointer back to us in the past. You could check out the replies in the past threads [1].
Maybe someone else who’s reading this knows a solution to correctly resolve XPointer id references? Maybe it helps to embed a more current version of Apache Xerces in the classpath?
1 - The presence of special characters such as the French "è" in the file path. For some reason this does not bother Oxygen or eXist, only BaseX.
Using non-ASCII characters shouldn’t cause any problems (or at least we are not aware of any); we regularly such use file paths by our own. Could you possibly provide us with a reproducible example?
Cordialement, Christian
[1] https://www.mail-archive.com/search?l=basex-talk%40mailman.uni-konstanz.de&a...
Thank you very much for helping me to reach these conclusions, which has allowed me to make a lot of progress:
1 - The problem is easy to solve: I just need to remove all traces of unconventionality from my file names (simple but it was necessary to think about it) 2 - I can put the items I want to include in the root of my file and avoid using the xpointer attribute. The only disadvantage of this is that my file is no longer valid with respect to the TEI and I can no longer take advantage of this scheme to organise their metadata. This won't stop me from working, but I'd like to take this opportunity to ask you if you also have an error when you use xpointer in your files? Is it simply a feature that BaseX does not support?
If necessary, here are the two files I use as a test for this purpose:
music.xml :
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml" xpointer="purple"/> </music>
label.xml:
<list><label xml:id="purple">Purple Records</label></list>
Again, Oxygen tells me for its part that everything is valid, and the tests with eXist included the xpointer feature. And if I remove the xpointer attribute, I have no errors in sight.
If needed, I work with Java version 11, Windows 10 and BaseX 10.4
Thanks again for everything,
Regards,
Virgile Reignier
A workaround might be to switch off XInclude during parsing and implement an XPointer-aware XInclude processing function in XQuery, using xquery:eval() or xquery:eval-update() in order to update documents in place after or prior to inserting them into a database. As I said, a workaround.
Gerrit
On 20.03.2023 13:38, Christian Grün wrote:
Hi Virgile,
Thanks for giving us an update.
2 - the use of the xpointer attribute in the xi:included tag, which systematically generates an error.
I see. Sorry for that. BaseX relies on the standard JDK library for parsing XML documents. Unfortunately, XPointer is only partially supported. It’s interesting to hear, though, that XPointer seems to be fully supported by eXist-db. I remember that other users reported problems with xpointer back to us in the past. You could check out the replies in the past threads [1].
Maybe someone else who’s reading this knows a solution to correctly resolve XPointer id references? Maybe it helps to embed a more current version of Apache Xerces in the classpath?
1 - The presence of special characters such as the French "è" in the file path. For some reason this does not bother Oxygen or eXist, only BaseX.
Using non-ASCII characters shouldn’t cause any problems (or at least we are not aware of any); we regularly such use file paths by our own. Could you possibly provide us with a reproducible example?
Cordialement, Christian
[1] https://www.mail-archive.com/search?l=basex-talk%40mailman.uni-konstanz.de&a...
Thank you very much for helping me to reach these conclusions, which has allowed me to make a lot of progress:
1 - The problem is easy to solve: I just need to remove all traces of unconventionality from my file names (simple but it was necessary to think about it) 2 - I can put the items I want to include in the root of my file and avoid using the xpointer attribute. The only disadvantage of this is that my file is no longer valid with respect to the TEI and I can no longer take advantage of this scheme to organise their metadata. This won't stop me from working, but I'd like to take this opportunity to ask you if you also have an error when you use xpointer in your files? Is it simply a feature that BaseX does not support?
If necessary, here are the two files I use as a test for this purpose:
music.xml :
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml" xpointer="purple"/> </music>
label.xml:
<list><label xml:id="purple">Purple Records</label></list>
Again, Oxygen tells me for its part that everything is valid, and the tests with eXist included the xpointer feature. And if I remove the xpointer attribute, I have no errors in sight.
If needed, I work with Java version 11, Windows 10 and BaseX 10.4
Thanks again for everything,
Regards,
Virgile Reignier
Hi Christian,
Thank you for your answer!
I took a look at the mail archives and read the suggestions to write the content of the xpointer attribute as xpointer="element(/1/nx1/nx2/.../nxn)". All this proposal manages to do for me is to generate an error in the validation of my file by Oxygen, without any effect on its import by BaseX.
I could also, as @Gerrit suggests, perform the inclusion from an xQuery formula. But it seems to me that this would be less convenient than learning to do without XPointer. Thanks anyway for your suggestion, I'll gladly take others if some of you still have ideas.
About the presence of non-ASCII characters, my two files music.xml and label.xml are currently in a "test_baseX" folder. If I change the folder name to " test_basèX", my import crashes. But this is something that is again related to XInclude, even if the folder name is not explicitly specified in the @href attribute: if I try to import label.xml, it works fine.
Thank you for your valuable help in any case,
Bests,
Virgile
Translated with www.DeepL.com/Translator (free version)
Christian Grün christian.gruen@gmail.com a écrit :
Hi Virgile,
Thanks for giving us an update.
2 - the use of the xpointer attribute in the xi:included tag, which systematically generates an error.
I see. Sorry for that. BaseX relies on the standard JDK library for parsing XML documents. Unfortunately, XPointer is only partially supported. It’s interesting to hear, though, that XPointer seems to be fully supported by eXist-db. I remember that other users reported problems with xpointer back to us in the past. You could check out the replies in the past threads [1].
Maybe someone else who’s reading this knows a solution to correctly resolve XPointer id references? Maybe it helps to embed a more current version of Apache Xerces in the classpath?
1 - The presence of special characters such as the French "è" in the file path. For some reason this does not bother Oxygen or eXist, only BaseX.
Using non-ASCII characters shouldn’t cause any problems (or at least we are not aware of any); we regularly such use file paths by our own. Could you possibly provide us with a reproducible example?
Cordialement, Christian
[1] https://www.mail-archive.com/search?l=basex-talk%40mailman.uni-konstanz.de&a...
Thank you very much for helping me to reach these conclusions, which has allowed me to make a lot of progress:
1 - The problem is easy to solve: I just need to remove all traces of unconventionality from my file names (simple but it was necessary to think about it) 2 - I can put the items I want to include in the root of my file and avoid using the xpointer attribute. The only disadvantage of this is that my file is no longer valid with respect to the TEI and I can no longer take advantage of this scheme to organise their metadata. This won't stop me from working, but I'd like to take this opportunity to ask you if you also have an error when you use xpointer in your files? Is it simply a feature that BaseX does not support?
If necessary, here are the two files I use as a test for this purpose:
music.xml :
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml" xpointer="purple"/> </music>
label.xml:
<list><label xml:id="purple">Purple Records</label></list>
Again, Oxygen tells me for its part that everything is valid, and the tests with eXist included the xpointer feature. And if I remove the xpointer attribute, I have no errors in sight.
If needed, I work with Java version 11, Windows 10 and BaseX 10.4
Thanks again for everything,
Regards,
Virgile Reignier
Hi Christian,
After a few interruptions, I resume working on my database. And I discover that XInclude continues in fact to generate errors: if I manage now very well to import a file which contains an XInclude, I cannot manage in the database these files by preserving these tags.
If I take the example of the two files that I presented before:
music.xml:
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml"/> </music>
label.xml
<list><label xml:id="purple">Purple Records</label></list>
Resolving the include during import gives me the following file:
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <list xml:base="label.xml"><label xml:id="purple">Purple Records</label></list> </music>
But for my part, I will need the inclusion to be kept in the files in order to be able to modify the label.xml file, include it in several other files and be able to call in real time the entities of this file. So I tried to modify the file in the database to make it return to its initial form, and I again get the binarization error that I initially got: the files are indicated as being in "binary" format and cannot be manipulated like XML files.
I also tried to transfer everything from my database to eXist, and as I had begun to see it worked quite well: I can import, export and above all manipulate in real time files that contain XIncludes linking to other files. But I'm also facing a new bug that I can't understand when editing these files via WebDAV: some files containing an XInclude do not open completely and stop after a certain number of lines.
Unless there is a miraculous solution, I think the easiest thing for me is to simply do without XInclude. What ultimately interests me in this technique is to make the link between entities identified in texts and entities gathered in an index. Even though XInclude has some serious advantages for making this link, I can still verify the integrity of the link using schematron rules built into a TEI-ODD.
Thank you in any case for your help and I look forward to discussing with you if it can be useful for you to understand the bug I am facing.
Best regards,
Virgile Reignier
Virgile Reignier virgile.reignier@u-picardie.fr a écrit :
Hi Christian,
Thank you for your answer!
I took a look at the mail archives and read the suggestions to write the content of the xpointer attribute as xpointer="element(/1/nx1/nx2/.../nxn)". All this proposal manages to do for me is to generate an error in the validation of my file by Oxygen, without any effect on its import by BaseX.
I could also, as @Gerrit suggests, perform the inclusion from an xQuery formula. But it seems to me that this would be less convenient than learning to do without XPointer. Thanks anyway for your suggestion, I'll gladly take others if some of you still have ideas.
About the presence of non-ASCII characters, my two files music.xml and label.xml are currently in a "test_baseX" folder. If I change the folder name to " test_basèX", my import crashes. But this is something that is again related to XInclude, even if the folder name is not explicitly specified in the @href attribute: if I try to import label.xml, it works fine.
Thank you for your valuable help in any case,
Bests,
Virgile
Translated with www.DeepL.com/Translator (free version)
Christian Grün christian.gruen@gmail.com a écrit :
Hi Virgile,
Thanks for giving us an update.
2 - the use of the xpointer attribute in the xi:included tag, which systematically generates an error.
I see. Sorry for that. BaseX relies on the standard JDK library for parsing XML documents. Unfortunately, XPointer is only partially supported. It’s interesting to hear, though, that XPointer seems to be fully supported by eXist-db. I remember that other users reported problems with xpointer back to us in the past. You could check out the replies in the past threads [1].
Maybe someone else who’s reading this knows a solution to correctly resolve XPointer id references? Maybe it helps to embed a more current version of Apache Xerces in the classpath?
1 - The presence of special characters such as the French "è" in the file path. For some reason this does not bother Oxygen or eXist, only BaseX.
Using non-ASCII characters shouldn’t cause any problems (or at least we are not aware of any); we regularly such use file paths by our own. Could you possibly provide us with a reproducible example?
Cordialement, Christian
[1] https://www.mail-archive.com/search?l=basex-talk%40mailman.uni-konstanz.de&a...
Thank you very much for helping me to reach these conclusions, which has allowed me to make a lot of progress:
1 - The problem is easy to solve: I just need to remove all traces of unconventionality from my file names (simple but it was necessary to think about it) 2 - I can put the items I want to include in the root of my file and avoid using the xpointer attribute. The only disadvantage of this is that my file is no longer valid with respect to the TEI and I can no longer take advantage of this scheme to organise their metadata. This won't stop me from working, but I'd like to take this opportunity to ask you if you also have an error when you use xpointer in your files? Is it simply a feature that BaseX does not support?
If necessary, here are the two files I use as a test for this purpose:
music.xml :
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml" xpointer="purple"/> </music>
label.xml:
<list><label xml:id="purple">Purple Records</label></list>
Again, Oxygen tells me for its part that everything is valid, and the tests with eXist included the xpointer feature. And if I remove the xpointer attribute, I have no errors in sight.
If needed, I work with Java version 11, Windows 10 and BaseX 10.4
Thanks again for everything,
Regards,
Virgile Reignier
Thanks, Virgilie,
that’s interesting. It seems that eXist-db includes the files only if files are output (serialized). I’ll be happy to get this confirmed by eXist-db users out there… As indicated, this can also be done with XQuery; see e.g. [1] or the following example:
Preparation: • turn xinclude off • create a database 'test' from a directory that contains music.xml and label.xml • run the following script:
declare namespace xi = 'http://www.w3.org/2001/XInclude'; declare function xi:enrich($node) { $node update { for $inc in .//xi:include let $href := $inc/@href let $included-doc := db:get(db:name($node), $href) update { insert node attribute xml:base { $href } into /* } return replace node $inc with $included-doc } }; xi:enrich(db:get('test', 'music.xml'))
Hope this helps, Christian
[1] https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg13388.htm...
On Fri, Mar 31, 2023 at 11:38 AM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Christian,
After a few interruptions, I resume working on my database. And I discover that XInclude continues in fact to generate errors: if I manage now very well to import a file which contains an XInclude, I cannot manage in the database these files by preserving these tags.
If I take the example of the two files that I presented before:
music.xml:
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml"/> </music>
label.xml
<list><label xml:id="purple">Purple Records</label></list>
Resolving the include during import gives me the following file:
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <list xml:base="label.xml"><label xml:id="purple">Purple Records</label></list> </music>
But for my part, I will need the inclusion to be kept in the files in order to be able to modify the label.xml file, include it in several other files and be able to call in real time the entities of this file. So I tried to modify the file in the database to make it return to its initial form, and I again get the binarization error that I initially got: the files are indicated as being in "binary" format and cannot be manipulated like XML files.
I also tried to transfer everything from my database to eXist, and as I had begun to see it worked quite well: I can import, export and above all manipulate in real time files that contain XIncludes linking to other files. But I'm also facing a new bug that I can't understand when editing these files via WebDAV: some files containing an XInclude do not open completely and stop after a certain number of lines.
Unless there is a miraculous solution, I think the easiest thing for me is to simply do without XInclude. What ultimately interests me in this technique is to make the link between entities identified in texts and entities gathered in an index. Even though XInclude has some serious advantages for making this link, I can still verify the integrity of the link using schematron rules built into a TEI-ODD.
Thank you in any case for your help and I look forward to discussing with you if it can be useful for you to understand the bug I am facing.
Best regards,
Virgile Reignier
Virgile Reignier virgile.reignier@u-picardie.fr a écrit :
Hi Christian,
Thank you for your answer!
I took a look at the mail archives and read the suggestions to write the content of the xpointer attribute as xpointer="element(/1/nx1/nx2/.../nxn)". All this proposal manages to do for me is to generate an error in the validation of my file by Oxygen, without any effect on its import by BaseX.
I could also, as @Gerrit suggests, perform the inclusion from an xQuery formula. But it seems to me that this would be less convenient than learning to do without XPointer. Thanks anyway for your suggestion, I'll gladly take others if some of you still have ideas.
About the presence of non-ASCII characters, my two files music.xml and label.xml are currently in a "test_baseX" folder. If I change the folder name to " test_basèX", my import crashes. But this is something that is again related to XInclude, even if the folder name is not explicitly specified in the @href attribute: if I try to import label.xml, it works fine.
Thank you for your valuable help in any case,
Bests,
Virgile
Translated with www.DeepL.com/Translator (free version)
Christian Grün christian.gruen@gmail.com a écrit :
Hi Virgile,
Thanks for giving us an update.
2 - the use of the xpointer attribute in the xi:included tag, which systematically generates an error.
I see. Sorry for that. BaseX relies on the standard JDK library for parsing XML documents. Unfortunately, XPointer is only partially supported. It’s interesting to hear, though, that XPointer seems to be fully supported by eXist-db. I remember that other users reported problems with xpointer back to us in the past. You could check out the replies in the past threads [1].
Maybe someone else who’s reading this knows a solution to correctly resolve XPointer id references? Maybe it helps to embed a more current version of Apache Xerces in the classpath?
1 - The presence of special characters such as the French "è" in the file path. For some reason this does not bother Oxygen or eXist, only BaseX.
Using non-ASCII characters shouldn’t cause any problems (or at least we are not aware of any); we regularly such use file paths by our own. Could you possibly provide us with a reproducible example?
Cordialement, Christian
[1] https://www.mail-archive.com/search?l=basex-talk%40mailman.uni-konstanz.de&a...
Thank you very much for helping me to reach these conclusions, which has allowed me to make a lot of progress:
1 - The problem is easy to solve: I just need to remove all traces of unconventionality from my file names (simple but it was necessary to think about it) 2 - I can put the items I want to include in the root of my file and avoid using the xpointer attribute. The only disadvantage of this is that my file is no longer valid with respect to the TEI and I can no longer take advantage of this scheme to organise their metadata. This won't stop me from working, but I'd like to take this opportunity to ask you if you also have an error when you use xpointer in your files? Is it simply a feature that BaseX does not support?
If necessary, here are the two files I use as a test for this purpose:
music.xml :
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml" xpointer="purple"/> </music>
label.xml:
<list><label xml:id="purple">Purple Records</label></list>
Again, Oxygen tells me for its part that everything is valid, and the tests with eXist included the xpointer feature. And if I remove the xpointer attribute, I have no errors in sight.
If needed, I work with Java version 11, Windows 10 and BaseX 10.4
Thanks again for everything,
Regards,
Virgile Reignier
Hi Christian,
It works very well indeed and I thank you for it. Unfortunately it seems to me that it doesn't really allow me to use XInclude in all its power: to edit a file and include it in other files, thus allowing elements present in the including file and in the included file to cohabit in real time (which is for me the meaning I intend to give to my files and which works very well if I edit the files outside a database). With this query, it would have to be run regularly to update the items included in the including files. It's not impossible, but in my case it seems to me that using schematron to check indexed entities are present in the index file is a bit more flexible.
Thank you for your help,
Sincerely and with pleasure,
Virgile Reignier
Christian Grün christian.gruen@gmail.com a écrit :
Thanks, Virgilie,
that’s interesting. It seems that eXist-db includes the files only if files are output (serialized). I’ll be happy to get this confirmed by eXist-db users out there… As indicated, this can also be done with XQuery; see e.g. [1] or the following example:
Preparation: • turn xinclude off • create a database 'test' from a directory that contains music.xml and label.xml • run the following script:
declare namespace xi = 'http://www.w3.org/2001/XInclude'; declare function xi:enrich($node) { $node update { for $inc in .//xi:include let $href := $inc/@href let $included-doc := db:get(db:name($node), $href) update { insert node attribute xml:base { $href } into /* } return replace node $inc with $included-doc } }; xi:enrich(db:get('test', 'music.xml'))
Hope this helps, Christian
[1] https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg13388.htm...
On Fri, Mar 31, 2023 at 11:38 AM Virgile Reignier virgile.reignier@u-picardie.fr wrote:
Hi Christian,
After a few interruptions, I resume working on my database. And I discover that XInclude continues in fact to generate errors: if I manage now very well to import a file which contains an XInclude, I cannot manage in the database these files by preserving these tags.
If I take the example of the two files that I presented before:
music.xml:
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml"/> </music>
label.xml
<list><label xml:id="purple">Purple Records</label></list>
Resolving the include during import gives me the following file:
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <list xml:base="label.xml"><label xml:id="purple">Purple Records</label></list> </music>
But for my part, I will need the inclusion to be kept in the files in order to be able to modify the label.xml file, include it in several other files and be able to call in real time the entities of this file. So I tried to modify the file in the database to make it return to its initial form, and I again get the binarization error that I initially got: the files are indicated as being in "binary" format and cannot be manipulated like XML files.
I also tried to transfer everything from my database to eXist, and as I had begun to see it worked quite well: I can import, export and above all manipulate in real time files that contain XIncludes linking to other files. But I'm also facing a new bug that I can't understand when editing these files via WebDAV: some files containing an XInclude do not open completely and stop after a certain number of lines.
Unless there is a miraculous solution, I think the easiest thing for me is to simply do without XInclude. What ultimately interests me in this technique is to make the link between entities identified in texts and entities gathered in an index. Even though XInclude has some serious advantages for making this link, I can still verify the integrity of the link using schematron rules built into a TEI-ODD.
Thank you in any case for your help and I look forward to discussing with you if it can be useful for you to understand the bug I am facing.
Best regards,
Virgile Reignier
Virgile Reignier virgile.reignier@u-picardie.fr a écrit :
Hi Christian,
Thank you for your answer!
I took a look at the mail archives and read the suggestions to write the content of the xpointer attribute as xpointer="element(/1/nx1/nx2/.../nxn)". All this proposal manages to do for me is to generate an error in the validation of my file by Oxygen, without any effect on its import by BaseX.
I could also, as @Gerrit suggests, perform the inclusion from an xQuery formula. But it seems to me that this would be less convenient than learning to do without XPointer. Thanks anyway for your suggestion, I'll gladly take others if some of you still have ideas.
About the presence of non-ASCII characters, my two files music.xml and label.xml are currently in a "test_baseX" folder. If I change the folder name to " test_basèX", my import crashes. But this is something that is again related to XInclude, even if the folder name is not explicitly specified in the @href attribute: if I try to import label.xml, it works fine.
Thank you for your valuable help in any case,
Bests,
Virgile
Translated with www.DeepL.com/Translator (free version)
Christian Grün christian.gruen@gmail.com a écrit :
Hi Virgile,
Thanks for giving us an update.
2 - the use of the xpointer attribute in the xi:included tag, which systematically generates an error.
I see. Sorry for that. BaseX relies on the standard JDK library for parsing XML documents. Unfortunately, XPointer is only partially supported. It’s interesting to hear, though, that XPointer seems to be fully supported by eXist-db. I remember that other users reported problems with xpointer back to us in the past. You could check out the replies in the past threads [1].
Maybe someone else who’s reading this knows a solution to correctly resolve XPointer id references? Maybe it helps to embed a more current version of Apache Xerces in the classpath?
1 - The presence of special characters such as the French "è" in the file path. For some reason this does not bother Oxygen or eXist, only BaseX.
Using non-ASCII characters shouldn’t cause any problems (or at least we are not aware of any); we regularly such use file paths by our own. Could you possibly provide us with a reproducible example?
Cordialement, Christian
[1]
https://www.mail-archive.com/search?l=basex-talk%40mailman.uni-konstanz.de&a...
Thank you very much for helping me to reach these conclusions, which has allowed me to make a lot of progress:
1 - The problem is easy to solve: I just need to remove all traces of unconventionality from my file names (simple but it was necessary to think about it) 2 - I can put the items I want to include in the root of my file and avoid using the xpointer attribute. The only disadvantage of this is that my file is no longer valid with respect to the TEI and I can no longer take advantage of this scheme to organise their metadata. This won't stop me from working, but I'd like to take this opportunity to ask you if you also have an error when you use xpointer in your files? Is it simply a feature that BaseX does not support?
If necessary, here are the two files I use as a test for this purpose:
music.xml :
<music xmlns:xi="http://www.w3.org/2001/XInclude"> <title>Smoke on the water</title> <artist>Deep Purple</artist> <xi:include href="label.xml" xpointer="purple"/> </music>
label.xml:
<list><label xml:id="purple">Purple Records</label></list>
Again, Oxygen tells me for its part that everything is valid, and the tests with eXist included the xpointer feature. And if I remove the xpointer attribute, I have no errors in sight.
If needed, I work with Java version 11, Windows 10 and BaseX 10.4
Thanks again for everything,
Regards,
Virgile Reignier
basex-talk@mailman.uni-konstanz.de