PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<DomDocument->html_dump_memDomDocumentType->entities()>
Last updated: Mon, 16 Jul 2012

DomDocument->xinclude

(no version information, might be only in CVS)

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

说明

int DomDocument->xinclude ( void )

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();

?>

上例将输出:

<?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_memDomDocumentType->entities()>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST