Hostign Towebs
 
    BUSCARDOR 
 
DOMNode->removeChild()

DOMNode->removeChild()

(no version information, might be only in CVS)

DOMNode->removeChild() --  Removes child from list of children

Descripción

class DOMNode {

DOMNode removeChild ( DOMNode oldnode )

}

This functions removes a child from a list of children.

Lista de parámetros

oldnode

The removed child.

Valores retornados

If the child could be removed the functions returns the old child.

Exceptions

DOM_NO_MODIFICATION_ALLOWED_ERR

Raised if this node is readonly.

DOM_NOT_FOUND

Raised if oldnode is not a child of this node.

Ejemplos

The following example will delete the chapter element of our XML document.

Ejemplo 1. Removing a child

<?php

$doc
= new DOMDocument;
$doc->load('book.xml');

$book = $doc->documentElement;

// we retrieve the chapter and remove it from the book
$chapter = $book->getElementsByTagName('chapter')->item(0);
$oldchapter = $book->removeChild($chapter);

echo
$doc->saveXML();
?>

El resultado del ejemplo seria:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
          "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<book id="listing">
 <title>My lists</title>
 
</book>



 
 
Rute path: HOME / MANUALES Y TUTORIALES / MANUAL DE PHP
Home | Hosting | Housing | Revendedores | Soporte | Empresa | Mapa del Sitio | Contacto | FAQ | Blog Corporativo
Atención técnica y comercial: (54)-11-5031-1111 las 24 hs. los 365 días del año. ToWebs, (c) 2008
Virtucom Networks S.A Av. Belgrano 1586, piso 10 (C1093AAQ) Cap. Fed. Bs. As, Argentina.