[basex-talk] Problem with xi:include - What is the correct href path?

Christian Grün christian.gruen at gmail.com
Wed Jun 10 10:40:21 CEST 2015


Hi Kristian,

I see the following alternatives (maybe there are more):

* If we continue to rely on Java's Xerces parser, which is the current
default parser in BaseX (see e.g. [1]). Obviously, we have no control
over the development, and I don't know much about its current status
quo. Maybe things improve with Java 9 [2]? Maybe you find some better
references on the web?

* We could also embed XInclude/XPointer support in our internal XML
parser (which is activated via the INTPARSE option). In this case, we
would have full control, but we would probably only do it as a
"sponsored feature" (financially backed by a customer).

Best,
Christian

[1] https://xerces.apache.org/xerces2-j/faq-xinclude.html#faq-8
[2] https://bugs.openjdk.java.net/browse/JDK-8038043


On Wed, Jun 10, 2015 at 8:50 AM, Kristian Kankainen
<kristian at keeleleek.ee> wrote:
> Hello!
>
> This is not the most appropriate place to ask, but I'd just like to get a
> hint of the overall feeling of it. Since the XInclude support is relied upon
> that of Java, is there any hope it will become complete some day? I'd be
> satisfied with answers like "I'm positive the support will be completed, but
> it might take some two years" or "the development seems stalled and probably
> nothing will happen if noone interested in it makes an effort".
>
> Thank you
> Kristian
>
>
> 08.06.2015 15:33, Christian Grün kirjutas:
>>
>> Dear Asxetos,
>>
>> BaseX relies on the XInclude support of Java, which is (unfortunately)
>> incomplete. Your example works locally when removing the xpointer
>> attribute (but it will include the full bar.xml resource).
>> Aditionally, please note that local or relative XInclude reference
>> cannot be resolved with DBA, because the file to be embedded will not
>> be available to the database server.
>>
>> If you are interested in getting more background information, please
>> check out another discussion on this issue on the mailing list [1].
>>
>> Hope this helps,
>> Christian
>>
>> [1]
>> https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg06197.html
>>
>>
>> On Mon, Jun 8, 2015 at 2:17 PM, Asxetos <pure.asxetos at gmail.com> wrote:
>>>
>>> Hello,
>>>
>>> I would like your help getting the following to work.
>>> I have document 'foo.xml' :
>>>
>>>
>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <?xml-model
>>> href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng"
>>> type="application/xml"
>>> schematypens="http://relaxng.org/ns/structure/1.0" ?>
>>> <TEI xmlns="http://www.tei-c.org/ns/1.0">
>>>    <teiHeader>
>>>      <fileDesc>
>>>        <titleStmt>
>>>          <title>foo</title>
>>>        </titleStmt>
>>>        <publicationStmt>
>>>          <ab></ab>
>>>        </publicationStmt>
>>>        <sourceDesc>
>>>          <ab></ab>
>>>        </sourceDesc>
>>>      </fileDesc>
>>>    </teiHeader>
>>>    <text>
>>>      <body>
>>>        <div>
>>>          <p>I am foo!</p>
>>>        </div>
>>>        <include xmlns="http://www.w3.org/2001/XInclude" href="bar.xml"
>>> xpointer="thebar"/>
>>>      </body>
>>>    </text>
>>> </TEI>
>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>>
>>>
>>> and document 'bar.xml' :
>>>
>>>
>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <?xml-model
>>> href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng"
>>> type="application/xml"
>>> schematypens="http://relaxng.org/ns/structure/1.0" ?>
>>> <TEI xmlns="http://www.tei-c.org/ns/1.0">
>>>      <teiHeader>
>>>          <fileDesc>
>>>              <titleStmt>
>>>                  <title>bar</title>
>>>              </titleStmt>
>>>              <publicationStmt>
>>>                  <ab></ab>
>>>              </publicationStmt>
>>>              <sourceDesc>
>>>                  <ab></ab>
>>>              </sourceDesc>
>>>          </fileDesc>
>>>      </teiHeader>
>>>      <text>
>>>          <body>
>>>              <div xml:id="thebar">
>>>                  <p>I am bar!</p>
>>>              </div>
>>>          </body>
>>>      </text>
>>> </TEI>
>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>>
>>>
>>> Using the administration interface (http://localhost:8984/dba)
>>> I create a new databse, add bar.xml and then try to add foo.xml
>>> This is what I get:
>>>
>>>
>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>> HTTP ERROR 400
>>>
>>> Problem accessing /dba/add. Reason:
>>>
>>>      Stopped at
>>> /Users/Asxetos/basex/webapp/dba/databases/resources/add.xqm,
>>> 91/10:
>>> [FODC0002] "foo.xml" (Line 22): An include with href 'bar.xml'failed,
>>> and no fallback element was found.
>>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>>
>>>
>>> I am guessing that the href path is not correct.
>>> What should the value of the href attribute be?
>>>
>>>
>>> Thanks,
>>> Asxetos
>>>
>>>
>>> PS: notice the error message says "with href 'bar.xml'failed". It seems
>>> the
>>>    404 page template is missing a whitespace after the filename.
>
>



More information about the BaseX-Talk mailing list