|
| Complete PHP DOM library prototype (from php.net manual) | |
Joined: 13 Sep 2007 |
Posts: 5 |
|
|
|
Posted: Wed Sep 12, 2007 7:21 am |
|
|
|
|
|
I wrote down the most complete DOM class prototype (includeing extended classes) - copy this to your phped/include_lib/ and choose this as your Code Insight include path. Working with DOM classes is a real charm now.
<?php
class DOMAttr extends DOMNode {
/**
* @var string
*/
var $name;
/**
* @var DOMElement
*/
var $ownerElement;
/**
* @var bool
*/
var $schemaTypeInfo;
/**
* @var bool
*/
var $specified;
/**
* @var string
*/
var $value;
/**
* @desc Creates a new DOMAttr object
* @param string
* @param string
*/
function __construct($name, $value = null) {}
/**
* @desc Checks if attribute is a defined ID
* @return bool
*/
function isId() {}
};
class DOMCharacterData extends DOMNode {
/**
* @var string
*/
var $data;
/**
* @var int
*/
var $length;
/**
* @desc Append the string to the end of the character data of the node
* @return void
* @param string
*/
function appendData($data) {}
/**
* @desc Remove a range of characters from the node
* @return void
* @param int
* @param int
*/
function deleteData($offset, $count) {}
/**
* @desc Insert a string at the specified 16-bit unit offset
* @return void
* @param int
* @param string
*/
function insertData($offset, $data) {}
/**
* @desc Replace a substring within the DOMCharacterData node
* @return void
* @param int
* @param int
* @param string
*/
function replaceData($offset, $count, $data) {}
/**
* @desc Extracts a range of data from the node
* @return void
* @param int
* @param int
*/
function substringData($offset, $count) {}
}
class DOMComment extends DOMCharacterData {
/**
* @desc Creates a new DOMComment object
* @param string
*/
function __construct($value = null) {}
};
class DOMDocument extends DOMNode {
/**
* @var string
*/
var $actualEncoding;
/**
* @var DOMConfiguration
*/
var $config;
/**
* @var DOMDocumentType
*/
var $doctype;
/**
* @var DOMElement
*/
var $documentElement;
/**
* @var string
*/
var $documentURI;
/**
* @var string
*/
var $encoding;
/**
* @var bool
*/
var $formatOutput;
/**
* @var DOMImplementation
*/
var $implementation;
/**
* @var bool
*/
var $preserveWhiteSpace;
/**
* @var bool
*/
var $recover;
/**
* @var bool
*/
var $resolveExternals;
/**
* @var bool
*/
var $standalone;
/**
* @var bool
*/
var $strictErrorChecking;
/**
* @var bool
*/
var $validateOnParse;
/**
* @var string
*/
var $version;
/**
* @var string
*/
var $xmlEncoding;
/**
* @var bool
*/
var $xmlStandalone;
/**
* @var string
*/
var $xmlVersion;
/**
* @desc Creates a new DOMDocument object
* @param string
* @param string
*/
function __construct($version = null, $encoding = null) {}
/**
* @desc Create new attribute
* @return DOMAttr
* @param string
*/
function createAttribute($name) {}
/**
* @desc Create new attribute node with an associated namespace
* @return DOMAttr
* @param string
* @param string
*/
function createAttributeNS($namespaceURI, $qualifiedName) {}
/**
* @desc Create new comment node
* @return DOMComment
* @param string
*/
function createComment($data) {}
/**
* @desc Create new document fragment
* @return DOMDocumentFragment
*/
function createDocumentFragment() {}
/**
* @desc Create new element node
* @return DOMElement
* @param string
* @param string
*/
function createElement($tagName, $value = null) {}
/**
* @desc Create new element node with an associated namespace
* @return DOMElement
* @param string
* @param string
* @param string
*/
function createElementNS($namespaceURI, $qualifiedName, $value = null) {}
/**
* @desc Create new entity reference node
* @return DOMEntityReference
* @param string
*/
function createEntityReference($name) {}
/**
* @desc Creates new PI node
* @return DOMProcessingInstruction
* @param string
* @param string
*/
function createProcessingInstruction($target, $data) {}
/**
* @desc Create new text node
* @return DOMText
* @param string
*/
function createTextNode($data) {}
/**
* @return DOMCdataSection
* @param string
*/
function createCDATASection($data) {}
/**
* @desc Searches for an element with a certain id
* @return DOMElement
* @param string
*/
function getElementById($elementId) {}
/**
* @desc Searches for all elements with given tag name
* @return DOMNodeList
* @param string
*/
function getElementsByTagName($tagname) {}
/**
* @desc Searches for all elements with given tag name in specified namespace
* @return DOMNodeList
* @param string
* @param string
*/
function getElementsByTagNameNS($namespaceURI, $localName) {}
/**
* @desc Import node into current document
* @return DOMNode
* @param DOMNode
* @param bool
*/
function importNode($importedNode, $deep) {}
/**
* @desc Load XML from a file
* @return bool
* @param string
* @param int
*/
function load($filename, $options = null) {}
/**
* @desc Load HTML from a string
* @return bool
* @param string
*/
function loadHTML($source) {}
/**
* @desc Load HTML from a file
* @return bool
* @param string
*/
function loadHTMLFile($filename) {}
/**
* @desc Load XML from a string
* @return bool
* @param string
* @param int
*/
function loadXML($source, $options = null) {}
/**
* @desc Normalizes the document
* @return void
*/
function normalizeDocument() {}
/**
* @desc Performs relaxNG validation on the document
* @return bool
* @param string
*/
function relaxNGValidate($filename) {}
/**
* @desc Performs relaxNG validation on the document
* @return bool
* @param string
*/
function relaxNGValidateSource($source) {}
/**
* @desc Register extended class used to create base node type (not DOM standard)
* @return bool
* @param string
* @param string
*/
function registerNodeClass($baseclass, $extendedclass) {}
/**
* @desc Dumps the internal XML tree back into a file
* @return int
* @param string
* @param int
*/
function save($filename, $options = null) {}
/**
* @desc Dumps the internal document into a string using HTML formatting
* @return string
*/
function saveHTML() {}
/**
* @desc Dumps the internal document back into a file using HTML formatting
* @return int
* @param string
*/
function saveHTMLFile($file) {}
/**
* @desc Dumps the internal XML tree back into a string
* @param DOMNode
* @param int
*/
function saveXML($node = null, $options = null) {}
/**
* @desc Validates a document based on a schema
* @return bool
* @param string
*/
function schemaValidate($filename) {}
/**
* @desc Validates a document based on a schema
* @return bool
* @param string
*/
function schemaValidateSource($source) {}
/**
* @desc Validates the document based on its DTD
* @return bool
*/
function validate() {}
/**
* @desc Substitutes XIncludes in a DOMDocument Object
* @return int - the number of XIncludes in the document
* @param int
*/
function xinclude($options = null) {}
};
class DOMDocumentFragment extends DOMNode {
/**
* @var string
*/
var $publicId;
/**
* @var string
*/
var $systemId;
/**
* @var string
*/
var $name;
/**
* @var DOMNamedNodeMap
*/
var $entities;
/**
* @var DOMNamedNodeMap
*/
var $notations;
/**
* @var string
*/
var $internalSubset;
/**
* @desc Append raw XML data (not DOM standard)
*/
function __construct() {}
/**
* @desc Append raw XML data (not DOM standard)
* @return bool
* @param string
*/
function appendXML($data) {}
};
class DOMElement extends DOMNode {
/**
* @var bool
*/
var $schemaTypeInfo;
/**
* @var string
*/
var $tagName;
/**
* @desc construct a new DOMElement object
* @param string
* @param string
* @param string
*/
function __construct($name, $value = null, $uri = null) {}
/**
* @desc Returns value of attribute
* @return string
* @param string
*/
function getAttribute($name) {}
/**
* @desc Returns attribute node
* @return DOMAttr
* @param string
*/
function getAttributeNode($name) {}
/**
* @desc Returns attribute node
* @return DOMAttr
* @param string
* @param string
*/
function getAttributeNodeNS($namespaceURI, $localName) {}
/**
* @desc Returns value of attribute
* @return string
* @param string
* @param string
*/
function getAttributeNS($namespaceURI, $localName) {}
/**
* @desc Gets elements by tagname
* @return DOMNodeList
* @param string
*/
function getElementsByTagName($name) {}
/**
* @desc Get elements by namespaceURI and localName
* @return DOMNodeList
* @param string
* @param string
*/
function getElementsByTagNameNS($namespaceURI, $localName) {}
/**
* @desc Checks to see if attribute exists
* @return bool
* @param string
*/
function hasAttribute($name) {}
/**
* @desc Checks to see if attribute exists
* @return bool
* @param string
* @param string
*/
function hasAttributeNS($namespaceURI, $localName) {}
/**
* @desc Removes attribute
* @return bool
* @param string
*/
function removeAttribute($name) {}
/**
* @desc Removes attribute
* @return DOMAttr
* @param DOMAttr
*/
function removeAttributeNode($oldAttr) {}
/**
* @desc Removes attribute
* @return bool
* @param string
* @param string
*/
function removeAttributeNS($namespaceURI, $localName) {}
/**
* @desc Adds new attribute
* @param name string
* @param value string
*/
function setAttribute($name, $value) {}
/**
* @desc Adds new attribute node to element
* @return bool
* @return DOMAttr
* @param DOMAttr
*/
function setAttributeNode($newAttr) {}
/**
* @desc Adds new attribute node to element
* @return DOMAttr
* @param DOMAttr
*/
function setAttributeNodeNS($newAttr) {}
/**
* @desc Adds new attribute
* @return bool
* @param string
* @param string
* @param string
*/
function setAttributeNS($namespaceURI, $qualifiedName, $value) {}
/**
* @desc Declares the ID attribute
* @return void
* @param string
* @param bool
*/
function setIdAttribute($name, $isId) {}
/**
* @desc Declares the ID attribute
* @return void
* @param attr
* @param bool
*/
function setIdAttributeNode($idAttr, $isId) {}
/**
* @desc Declares the ID attribute
* @return void
* @param string
* @param string
* @param bool
*/
function setIdAttributeNS($namespaceURI, $localName, $isId) {}
};
class DOMEntity extends DOMNode{
/**
* @var string
*/
var $publicId;
/**
* @var string
*/
var $systemId;
/**
* @var string
*/
var $notationName;
/**
* @var string
*/
var $actualEncoding;
/**
* @var string
*/
var $encoding;
/**
* @var string
*/
var $version;
}
class DOMEntityReference extends DOMNode {
/**
* @desc construct a new DOMEntityReference object
* @param name string
*/
function __construct($name) {}
};
class DOMException {
/**
* @var int
*/
var $code;
}
class DOMImplementation {
/**
* @desc Creates a new DOMImplementation object
*/
function __construct() {}
/**
* @desc Creates a DOM Document object of the specified type with its document element
* @param string
* @param string
* @param DOMDocumentType
* @return DOMDocument
*/
function createDocument($namespaceURI = null, $qualifiedName = null, $doctype = null) {}
/**
* @desc Creates an empty DOMDocumentType object
* @param string
* @param string
* @param string
* @return DOMDocumentType
*/
function createDocumentType($qualifiedName = null, $publicId = null, $systemId = null) {}
/**
* @desc Test if the DOM implementation implements a specific feature
* @param string
* @param string
* @return bool
*/
function hasFeature($feature, $version) {}
}
class DOMNamedNodeMap {
/**
* @desc Retrieves a node specified by name
* @return DOMNode
* @param string
*/
function getNamedItem($name) {}
/**
* @desc Retrieves a node specified by local name and namespace URI
* @return DOMNode
* @param string
* @param string
*/
function getNamedItemNS($namespaceURI, $localName) {}
/**
* @desc Retrieves a node specified by index
* @return DOMNode
* @param int
*/
function item($index) {}
}
class DOMNode {
/**
* @var string
*/
var $nodeName;
/**
* @var string
*/
var $nodeValue;
/**
* @var int
*/
var $nodeType;
/**
* @var DOMNode
*/
var $parentNode;
/**
* @var DOMNodeList
*/
var $childNodes;
/**
* @var DOMNode
*/
var $firstChild;
/**
* @var DOMNode
*/
var $lastChild;
/**
* @var DOMNode
*/
var $previousSibling;
/**
* @var DOMNode
*/
var $nextSibling;
/**
* @var DOMNamedNodeMap
*/
var $attributes;
/**
* @var DOMDocument
*/
var $ownerDocument;
/**
* @var string
*/
var $namespaceURI;
/**
* @var string
*/
var $prefix;
/**
* @var string
*/
var $localName;
/**
* @var string
*/
var $baseURI;
/**
* @var string
*/
var $textContent;
/**
* @desc Adds new child at the end of the children
* @return DOMNode
* @param DOMNode
*/
function appendChild($newnode) {}
/**
* @desc Clones a node
* @return DOMNode
* @param bool
*/
function cloneNode($deep = false) {}
/**
* @desc Checks if node has attributes
* @return bool
*/
function hasAttributes() {}
/**
* @desc Checks if node has children
* @return bool
*/
function hasChildNodes() {}
/**
* @desc Adds a new child before a reference node
* @return DOMNode
* @param DOMNode
* @param DOMNode
*/
function insertBefore($newnode, $refnode = null) {}
/**
* @desc Checks if the specified namespaceURI is the default namespace
* @return bool
* @param string
*/
function isDefaultNamespace($namespaceURI) {}
/**
* @desc Indicates if two nodes are the same node
* @return bool
* @param DOMNode
*/
function isSameNode($node) {}
/**
* @desc Checks if feature is supported for specified version
* @return bool
* @param string
* @param string
*/
function isSupported($feature, $version) {}
/**
* @desc Returns namespace URI of the node based on the prefix
* @return string
* @param string
*/
function lookupNamespaceURI($prefix) {}
/**
* @desc Returns name space prefix of the node based on namespaceURI
* @return string
* @param string
*/
function lookupPrefix($namespaceURI) {}
/**
* @desc Normalizes the node
*/
function normalize() {}
/**
* @desc Removes child from list of children
* @return DOMNode
* @param DOMNode
*/
function removeChild($oldnode) {}
/**
* @desc Replaces a child
* @return DOMNode
* @param DOMNode
* @param DOMNode
*/
function replaceChild($newnode, $oldnode) {}
}
class DOMNodeList {
/**
* @var int
*/
var $length;
/**
* @desc Retrieves a node specified by index
* @param int
* @return DOMNode
*/
function item($index) {}
}
class DOMNotation extends DOMNode {
/**
* @var string
*/
var $publicId;
/**
* @var string
*/
var $systemId;
}
class DOMProcessingInstruction {
/**
* @var string
*/
var $target;
/**
* @var string
*/
var $data;
/**
* @desc construct a new DOMProcessingInstruction object
* @param string
* @param string
*/
function __construct($name, $value = null) {}
};
class DOMText {
/**
* @var string
*/
var $wholeText;
/**
* @desc construct a new DOMText object
* @param string
*/
function __construct($value = null) {}
/**
* @desc Breaks the node into two nodes at the specified offset
* @return DOMText
* @param int
*/
function splitText($offset) {}
/**
* @desc Indicates whether this text node contains whitespace
* @return bool
*/
function isWhitespaceInElementContent() {}
};
class DOMXPath {
/**
* @var DOMDocument
*/
var $document;
/**
* @desc construct a new DOMXPath object
* @param DOMDocument
*/
function __construct($doc) {}
/**
* @desc Registers the namespace with the DOMXpath objec
* @return bool
* @param string
* @param string
*/
function registerNamespace($prefix, $namespaceURI) {}
/**
* @desc Evaluates the given XPath expression and returns a typed result if possible
* @return DOMNodeList
* @param string
* @param DOMNode
*/
function evaluate($expression, $contextnode = null) {}
/**
* @desc Evaluates the given XPath expression
* @return DOMNodeList
* @param string
* @param DOMNode
*/
function query($expression, $contextnode = null) {}
};
?>
|
|
|
|
| | |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT - 5 Hours
Page 1 of 1
|
|
|
| |