forked from joonty/myvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDomDocument-xinclude.txt
44 lines (30 loc) · 933 Bytes
/
DomDocument-xinclude.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
*DomDocument->xinclude* -- Substitutes XIncludes in a DomDocument Object
int DomDocument->xinclude()~
This function substitutes XIncludes in a DomDocument object.
Substituting Xincludes
<?php >
// include.xml contains :
// <child>test</child>
$xml = '<?xml version="1.0"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="include.xml">
<xi:fallback>
<error>xinclude: include.xml not found</error>
</xi:fallback>
</xi:include>
</root>';
$domxml = domxml_open_mem($xml);
$domxml->xinclude();
echo $domxml->dump_mem();
?>
The above example will output:
<?xml version="1.0"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude">
<child>test</child>
</root>
If include.xml doesn't exist, you'll see:
<?xml version="1.0"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude">
<error>xinclude:dom.xml not found</error>
</root>
vim:ft=help: