Web студия "GrandView"
  Главная   Написать Контакты
   
   
О проекте
Руководство php
 

DomNode->node_type

(no version information, might be only in CVS)

DomNode->node_type --  Returns type of node

Описание

int DomNode->node_type ( void )

Returns the type of the node. All possible types are listed in the table in the introduction.

Пример 1.

<?php

include 'example.inc';

$dom = domxml_open_mem($xmlstr);

$chapter = $dom->document_element();

// Let's see the elements contained in chapter
foreach($chapter->child_nodes() as $node) {
  if (
$node->node_type() == XML_ELEMENT_NODE) {
    echo
$node->node_name() . "\n";
  }
}

?>

Результат выполнения данного примера:

title
para


add a note add a note User Contributed Notes
DomNode->node_type
wasti dot redl at gmx dot net
23-May-2005 01:40
That's not a parser issue, that's according to the DOM specification.

> Attr objects inherit the Node interface, but since they are not
> actually child nodes of the element they describe, the DOM does
> not consider them part of the document tree.

They are not child nodes, so they shouldn't be in the child_nodes collection.
17-Jun-2003 12:37
Doesn't pick up nodes of type XML_ATTRIBUTE_NODE (attributes)

Use DomNode->has_attributes() then DomNode->attributes() to retrieve a list (NameNodeMap object) of Attr objects for current node.

Is likely to be a parser issue, I'm using version 2.4.19-4 of libxml2.

Pete.

DomNode->node_value> <DomNode->node_name
Last updated: Sat, 27 Jan 2007
 
 
Новости
11 июля 2007
Сайт запущен
© 2007 info@grandviewstudio.com

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 324

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 330
Z058440144362 Z348613067571