mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-05 19:35:54 +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:
@@ -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>
|
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 @@
|
|||||||
<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"/>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<?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>
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<?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>
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
<?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>
|
||||||
|
14
xinclude.c
14
xinclude.c
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user