oops I was missing the xml:base fixup too this adds xml:base attributes to
* xinclude.c: oops I was missing the xml:base fixup too
* result/XInclude/*.xml: this adds xml:base attributes to most
results of the tests
Daniel
diff --git a/ChangeLog b/ChangeLog
index fd8b9f8..87f5da4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Aug 14 16:43:53 CEST 2002 Daniel Veillard <daniel@veillard.com>
+
+ * xinclude.c: oops I was missing the xml:base fixup too
+ * result/XInclude/*.xml: this adds xml:base attributes to most
+ results of the tests
+
Wed Aug 14 16:05:37 CEST 2002 Daniel Veillard <daniel@veillard.com>
* xinclude.c: quick but apparently working implementation of
diff --git a/result/XInclude/docids.xml b/result/XInclude/docids.xml
index a383e7f..389a216 100644
--- a/result/XInclude/docids.xml
+++ b/result/XInclude/docids.xml
@@ -11,7 +11,7 @@
<isid myid="dup"/>
</doc>
<!-- including another XML document with IDs -->
-<doc>
+<doc xml:base="test/XInclude/ents/ids.xml">
<isid myid="dup"/>
<isid myid="foo"/>
<isid myid="bar"/>
diff --git a/result/XInclude/include.xml b/result/XInclude/include.xml
index a0f6dc4..bee9da2 100644
--- a/result/XInclude/include.xml
+++ b/result/XInclude/include.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<x xmlns:xinclude="http://www.w3.org/2001/XInclude">
<!-- Simple test of including another XML document -->
- <doc>
+ <doc xml:base="test/XInclude/ents/something.xml">
<p>something</p>
<p>really</p>
<p>simple</p>
diff --git a/result/XInclude/nodes.xml b/result/XInclude/nodes.xml
index 83ce694..301b70d 100644
--- a/result/XInclude/nodes.xml
+++ b/result/XInclude/nodes.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<x xmlns:xinclude="http://www.w3.org/2001/XInclude">
<!-- Simple test of including a set of nodes from an XML document -->
- <p>something</p><p>really</p><p>simple</p>
+ <p xml:base="test/XInclude/ents/something.xml">something</p><p xml:base="test/XInclude/ents/something.xml">really</p><p xml:base="test/XInclude/ents/something.xml">simple</p>
</x>
diff --git a/result/XInclude/recursive.xml b/result/XInclude/recursive.xml
index df74d50..c218c7d 100644
--- a/result/XInclude/recursive.xml
+++ b/result/XInclude/recursive.xml
@@ -1,3 +1,3 @@
<?xml version="1.0"?>
-<this><sub-inc>is a test
+<this><sub-inc xml:base="test/XInclude/ents/sub-inc.ent">is a test
</sub-inc></this>
diff --git a/xinclude.c b/xinclude.c
index 63cb5e9..e2c4af0 100644
--- a/xinclude.c
+++ b/xinclude.c
@@ -892,6 +892,20 @@
xmlXPathFreeContext(xptrctxt);
xmlFree(fragment);
}
+
+ /*
+ * Do the xml:base fixup if needed
+ */
+ if ((doc != NULL) && (URL != NULL) && (xmlStrchr(URL, (xmlChar) '/'))) {
+ xmlNodePtr node;
+
+ node = ctxt->repTab[nr];
+ while (node != NULL) {
+ if (node->type == XML_ELEMENT_NODE)
+ xmlNodeSetBase(node, URL);
+ node = node->next;
+ }
+ }
xmlFree(URL);
return(0);
}