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

search for in the

DOMImplementation::createDocumentType> <DOMImplementation::__construct
Last updated: Fri, 13 Nov 2009

view this page in

DOMImplementation::createDocument

(PHP 5)

DOMImplementation::createDocument 指定した型とドキュメント要素の DOMDocument オブジェクトを作成する

説明

DOMDocument DOMImplementation::createDocument ([ string $namespaceURI = NULL [, string $qualifiedName = NULL [, DOMDocumentType $doctype = NULL ]]] )

指定した型とドキュメント要素の DOMDocument オブジェクトを作成します。

パラメータ

namespaceURI

作成するドキュメント要素の名前空間 URI。

qualifiedName

作成するドキュメント要素の修飾名。

doctype

作成するドキュメントの型、あるいは NULL

返り値

新しい DOMDocument オブジェクトを返します。 namespaceURIqualifiedName および doctype が null の場合は、 ドキュメント要素を含まない空の DOMDocument を返します。

エラー / 例外

DOM_WRONG_DOCUMENT_ERR

doctype が既に別のドキュメントで使用されていたり、 別の実装で作成されている場合に発生します。

DOM_NAMESPACE_ERR

namespaceURI および qualifiedName で指定した名前空間に間違いがある場合に発生します。

参考



add a note add a note User Contributed Notes
DOMImplementation::createDocument
arturm at union dot com dot pl
06-May-2006 05:23
To create HTML document with doctype:

<?php
$doctype
= DOMImplementation::createDocumentType("html",
               
"-//W3C//DTD HTML 4.01//EN",
               
"http://www.w3.org/TR/html4/strict.dtd");
$doc = DOMImplementation::createDocument(null, 'html', $doctype);
?>

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