mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-04 12:58:17 +03:00
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
This commit is contained in:
parent
e3b7d9a165
commit
c4bad4a77c
@ -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
|
||||
|
@ -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"/>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
14
xinclude.c
14
xinclude.c
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user