PHP 手冊
前一頁 |  | 下一頁

# DomDocument->xinclude

(no version information, might be only in CVS)

DomDocument->xinclude -- Substitutes XIncludes in a DomDocument Object

## Description

int DomDocument->xinclude ( void )

警告
這個函數是實驗性質的。這個函數的行為、名稱、和關於此函數的任何其他文件在未來PHP的發行中可能會在不通知的情況下改變。 使用此延伸需自行承擔風險。

This function substitutes XIncludes in a DomDocument object.

範例 1. 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>

前一頁 | 內容 | 下一頁
DomDocument->html_dump_mem | 上一層 | DomDocumentType->entities