downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

DOMElement::getAttribute> <DOMElement
[edit] Last updated: Fri, 23 Mar 2012

view this page in

DOMElement::__construct

(PHP 5)

DOMElement::__constructYeni bir DOMElement nesnesi oluşturur

Açıklama

__construct ( string $isim [, string $değer [, string $uri ]] )

Yeni bir DOMElement nesnesi oluşturur. Bu nesne salt okunurdur. Nesne bu haliyle bir belgeye eklenebilir, fakat belge ile ilişkilendirilinceye kadar yeni bir düğüm eklenemez. Yazılabilir bir düğüm oluşturmak için DOMDocument::createElement() veya DOMDocument::createElementNS() yöntemlerini kullanın.

Değiştirgeler

isim

Elemanın etiket ismi. Bir isim alanı betimleyicisi belirtildiği takdirde eleman ismi bu isim alanı ile ilişkili bir önek alabilir.

değer

Elemanın değeri.

uri

Elemanın bir isim alanına ait olması halinde bu isim alanını betimleyen adres.

Örnekler

Örnek 1 - Yeni bir DOMElement oluşturmak

<?php

$dom 
= new DOMDocument('1.0''utf-8');
$element $dom->appendChild(new DOMElement('kök'));
$element_ns = new DOMElement('bir:düğüm1''birdeğer''http://rst');
$element->appendChild($element_ns);
echo 
$dom->saveXML(); /* <?xml version="1.0" encoding="utf-8"?>
<kök><bir:düğüm1 xmlns:bu="http://rst">birdeğer</bir:düğüm1></kök> */

?>

Ayrıca Bakınız



DOMElement::getAttribute> <DOMElement
[edit] Last updated: Fri, 23 Mar 2012
 
add a note add a note User Contributed Notes DOMElement::__construct
Fabian dot Blech at gmx dot de 22-Jul-2010 08:30
Remember, Dom-Nodes mustn't start with a number:

allowed:
<t12345t4>Value</t12345t4>

Not allowed:
<12345t4>VALUE</12345t4>
troelskn at gmail dot com 03-Jun-2008 07:46
Note that this function is buggy. You have to manually escape the $value argument with htmlspecialchars.
See: http://bugs.php.net/bug.php?id=31191
adar at darkpoetry dot de 07-May-2007 01:27
If you like to view an element simply do:

<?php
echo htmlentities($element->C14N());
?>

Undocumented but found ;)

 
show source | credits | sitemap | contact | advertising | mirror sites