DomNode->node_value

(no version information, might be only in CVS)

DomNode->node_value --  Returns value of a node

Описание

string DomNode->node_value ( void )

Returns value of the node. The value has different meanings for the different types of nodes as illustrated in the following table.

Таблица 1. Meaning of value

TypeMeaning
DomAttributevalue of attribute
DomAttribute 
DomCDataSectioncontent
DomCommentcontent of comment
DomDocumentnull
DomDocumentTypenull
DomElementnull
DomEntitynull
DomEntityReferencenull
DomNotationnull
DomProcessingInstructionentire content without target
DomTextcontent of text



DomNode->node_value
rsl at zonapersonal dot com
27-Jan-2006 04:18
Inmost work with HTML and browsers you may need to use

$text=utf8_decode($domnode->nodeValue);
or
$text=htmlentities(utf8_decode($domnode->nodeValue));

insted of

$text=$domnode->nodeValue;

To have a browser readable output spetialy if you deal with things like & etc or &áá etc.
Salman
01-Oct-2003 05:42
To get the contents of the node, which is for instance:

<a>this is a test</a>

To get the string: "this is a test" use:

// assuming dom is an actual xml-dom
$temp = $dom->get_elements_by_tagname("a");
foreach($temp as $nexta) {
   echo $nexta->get_content();
}

- Salman
http://www.setcomputing.com/

<DomNode->node_typeDomNode->owner_document>
 Last updated: Mon, 14 Nov 2005