[xml] Problem keeping track of the base URI of included documents
- From: Benjamin Habegger <Benjamin Habegger irin univ-nantes fr>
- To: xml gnome org
- Subject: [xml] Problem keeping track of the base URI of included documents
- Date: 08 Mar 2002 18:56:25 +0100
Hello,
I am having problems getting my references right when using libxml with xinclude.
I have a 3 files, in two separate directories (given here relatively to the current directory) :
test.xml
somewhere/other.xml
somewhere/hello
with the following contents :
<!-- test.xml -->
<?xml version="1.0" encoding="iso-8859-1"?>
<test xmlns:xi="
http://www.w3.org/2001/XInclude">
<xi:include href="" />
</test>
<!-- somewhere/other.xml -->
<?xml version="1.0" encoding="iso-8859-1" ?>
<just-a-test>
<myref href="" />
</just-a-test>
the content of hello doesn't matter
Why expanding the xinclude nodes in test.xml we get the folling document
<!-- result of 'xmllint --xinclude test.xml' --->
<?xml version="1.0" encoding="iso-8859-1"?>
<test xmlns:xi="
http://www.w3.org/2001/XInclude">
<just-a-test>
<myref href=""
</just-a-test>
</test>
After the inclusion my reference to the file hello is wrong since the base URI of test.xml and other.xml is not the same. As I understood it in the W3C specifiation of XInclude(
http://www.w3.org/TR/xinclude/#base) an xml:base attribute infoset should have been added to the toplevel included items (in my case the <just-a-test> element).
Is this a bug in libxml2 (I have version 2.4.16) or did I misunderstand or miss something in the specifiation ?
In the second case what solution do I have to solve my problem knowing that my objective is only to do an xsl transformation (I could write a program solving the problem but that solution doesn't satisfy me since it is not generic).
Thank you in advance for your help,
Benjamin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]