update : 2015.11.03
php.shukuma.com검색:
|
DOMDocument::createElementNS(PHP 5, PHP 7) DOMDocument::createElementNS — Create new element node with an associated namespace 설명
public DOMElement DOMDocument::createElementNS
( string
$namespaceURI
, string $qualifiedName
[, string $value
] )This function creates a new element node with an associated namespace. 이 노드는 DOMNode::appendChild() 등을 통하여 삽입하지 않으면 보여지지 않습니다. 인수
반환값
The new DOMElement or 오류/예외
예제
Example #1 Creating a new element and inserting it as root
<?php 위 예제의 출력: <?xml version="1.0" encoding="utf-8"?> <xfoo:test xmlns:xfoo="http://www.example.com/XFoo">This is the root element!</xfoo:test> Example #2 A namespace prefix example
<?php 위 예제의 출력: <?xml version="1.0" encoding="utf-8"?> <element xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0"> <g:item_type>house</g:item_type> </element> http://base.google.com/ns/1.0 g item_type 참고
|