DomDocument->xinclude

(no version information, might be only in CVS)

DomDocument->xinclude -- Remplace XIncludes dans un objet DomDocument

Description

int DomDocument->xinclude ( void )

DomDocument->xinclude() substitue XIncludes dans un objet DomDocument.

Exemple 1. Substitution des Xincludes

<?php

// include.xml contient :
// <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 n\'a pas été trouvé</error>
    </xi:fallback>
  </xi:include>
</root>'
;

$domxml = domxml_open_mem($xml);
$domxml->xinclude();

echo
$domxml->dump_mem();

?>

L'exemple ci-dessus va afficher :

<?xml version="1.0"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude">
  <child>test</child>
</root>

Si include.xml n'existe pas, vous verez :

<?xml version="1.0"?>
<root xmlns:xi="http://www.w3.org/2001/XInclude">
  <error>xinclude:dom.xml n'a pas été trouvé</error>
</root>

Hosting by: Hurra Communications GmbH
Generated: 2007-01-26 18:02:04