Commit c4bad4a7 authored by Daniel Veillard's avatar Daniel Veillard

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
parent e3b7d9a1
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
......
......@@ -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"/>
......
<?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>
......
<?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>
<?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>
......@@ -892,6 +892,20 @@ loaded:
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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment