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> Wed Aug 14 16:05:37 CEST 2002 Daniel Veillard <daniel@veillard.com>
* xinclude.c: quick but apparently working implementation of * xinclude.c: quick but apparently working implementation of
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<isid myid="dup"/> <isid myid="dup"/>
</doc> </doc>
<!-- including another XML document with IDs --> <!-- including another XML document with IDs -->
<doc> <doc xml:base="test/XInclude/ents/ids.xml">
<isid myid="dup"/> <isid myid="dup"/>
<isid myid="foo"/> <isid myid="foo"/>
<isid myid="bar"/> <isid myid="bar"/>
......
<?xml version="1.0"?> <?xml version="1.0"?>
<x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <x xmlns:xinclude="http://www.w3.org/2001/XInclude">
<!-- Simple test of including another XML document --> <!-- Simple test of including another XML document -->
<doc> <doc xml:base="test/XInclude/ents/something.xml">
<p>something</p> <p>something</p>
<p>really</p> <p>really</p>
<p>simple</p> <p>simple</p>
......
<?xml version="1.0"?> <?xml version="1.0"?>
<x xmlns:xinclude="http://www.w3.org/2001/XInclude"> <x xmlns:xinclude="http://www.w3.org/2001/XInclude">
<!-- Simple test of including a set of nodes from an XML document --> <!-- 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> </x>
<?xml version="1.0"?> <?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> </sub-inc></this>
...@@ -892,6 +892,20 @@ loaded: ...@@ -892,6 +892,20 @@ loaded:
xmlXPathFreeContext(xptrctxt); xmlXPathFreeContext(xptrctxt);
xmlFree(fragment); 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); xmlFree(URL);
return(0); 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