-
Notifications
You must be signed in to change notification settings - Fork 0
/
DOMImplementation.php
executable file
·47 lines (40 loc) · 1.5 KB
/
DOMImplementation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/*
* PHP DOM: Implementation of the Document Object Model (DOM) Level 3 Core Specification <http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226> in PHP.
* Jonas Raoni Soares da Silva <http://raoni.org>
* https://github.com/jonasraoni/php-dom
*/
class DOMImplementation {
var $_features = array(),
$_class = null,
$_createDoc = null,
$_createDocType = null;
function DOMImplementation($createDoc, $createDocType, $features=array()){
Global $DOMImplementationList;
$this->_features = &$features;
$this->_createDoc = $createDoc;
$this->_createDocType = $createDocType;
$DOMImplementationList->_add($this);
}
function hasFeature($feature, $version){
if(IsSet($this->_features[$feature])) return IsSet($this->_features[$feature][$version]);
return false;
}
function &getFeature($feature, $version){
return hasFeature($feature, $version) ? new $this->_features[$feature][$version] : null;
}
function &createDocumentType($qualifiedName, $publicId=null, $systemId=null){
$docType = &new $this->_createDocType($qualifiedName, $this, $publicId, $systemId);
$docType->ownerDocument=null;
return $docType;
}
function &createDocument($qualifiedName, $namespaceURI=null, $docType=null){
$doc = &new $this->_createDoc;
$doc->_setName($qualifiedName, $namespaceURI);
$doc->docType = $docType;
return $doc;
}
function _setFeature($feature, $version='1.0', $specializedObject=''){
$this->_features[$feature][$version]=$specializedObject;
}
}