Rechercher une fonction PHP

DOMImplementation: : createDocumentType

(PHP 5, PHP 7)

DOMImplementation::createDocumentType Creates an empty DOMDocumentType object

Description

public DOMImplementation::createDocumentType ([ string $qualifiedName = NULL [, string $publicId = NULL [, string $systemId = NULL ]]] ) : DOMDocumentType

Creates an empty DOMDocumentType object. Entity declarations and notations are not made available. Entity reference expansions and default attribute additions do not occur.

PHP: DOMImplementation::createDocumentType - Manual Home of Manuel PHP  Contents Haut

Parameters

qualifiedName

The qualified name of the document type to create.

publicId

The external subset public identifier.

systemId

The external subset system identifier.

PHP: DOMImplementation::createDocumentType - Manual Home of Manuel PHP  Contents Haut

Return Values

A new DOMDocumentType node with its ownerDocument set to NULL.

PHP: DOMImplementation::createDocumentType - Manual Home of Manuel PHP  Contents Haut

Errors/Exceptions

DOM_NAMESPACE_ERR

Raised if there is an error with the namespace, as determined by qualifiedName.

This method may be called statically, but will issue an E_STRICT error.

PHP: DOMImplementation::createDocumentType - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 Creating a document with an attached DTD

<?php

// Creates an instance of the DOMImplementation class
$imp = new DOMImplementation;

// Creates a DOMDocumentType instance
$dtd $imp->createDocumentType('graph''''graph.dtd');

// Creates a DOMDocument instance
$dom $imp->createDocument(""""$dtd);

// Set other properties
$dom->encoding 'UTF-8';
$dom->standalone false;

// Create an empty element
$element $dom->createElement('graph');

// Append the element
$dom->appendChild($element);

// Retrieve and print the document
echo $dom->saveXML();

?>

The above example will output:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE graph SYSTEM "graph.dtd">
<graph/>

PHP: DOMImplementation::createDocumentType - Manual Home of Manuel PHP  Contents Haut

See Also

Find a PHP function

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-domimplementation.createdocumenttype.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : http://php.net

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut