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