PHP5: ext/dom: some documentation code
[email protected] (Vivian Steller) Tue, 17 Feb 2004 03:11:16 +0100
| Newsgroups | php.xml.dev |
|---|---|
| Message-ID | <[email protected]> |
hello at all,
maybe some other people need a bit more documentation... hope you'll enjoy.
Sorry for the heavy post.
so far,
vivi
here it is:
<?php
/* DomCoreClass Documentation */
/* Last modified: 2004-02-17 02:50 */
/* by Vivian Steller <[email protected]> */
/*
I wrote this document to get familiar with the
new DOM Implementation of PHP5 based on LibXML2.
Maybe I can help other programmers who can't await
the official release of PHP5 and dedicated
documentations with this document.
I have to admit that it isn't that professional
to write this very 'technical' document without the
help of the new reflection classes - maybe it would
be better, I haven't tried... buh.
So, if you find a more proper documentation or if you
recognize
- mistakes in my code
- changes made to the source code of ext/dom
- differences to the W3C-Standard (maybe only naming-
conventions etc.)
- other improvements
PLEASE LET OUS KNOW!!
Links:
You can download this file and newer versions from:
http://www.eecoo.de/downloads/domdocumentation.txt
Have a look at the current developement of ext/dom:
http://cvs.php.net/cvs.php/php-src/ext/dom
The W3C DOM Documentation is the "big guideline":
http://www.w3.org/TR/2004/PR-DOM-Level-3-Core-20040205/core.html
Have a lot of fun...
*/
class DomException extends exception {
}
class DomStringList {
public $length = 0; // readonly
public function item($index) {
// not yet implemented
}
}
class DomNamelist {
public $length = 0; // readonly
public function getName($index) {
// not yet implemented
}
public function getNamespaceURI($index) {
// not yet implemented
}
}
class DomImplementationList {
public $length = 0; // readonly
public function item($index) {
// not yet implemented
}
}
class DomImplementationSource {
public function getDomImplementation($features) {
// not yet implemented
}
public function getDomImplementations($features) {
// not yet implemented
}
}
class DomImplementation {
public function hasFeature($feature, $version) {
}
public function createDocumentType($qualifiedName, $publicId, $systemId) {
}
public function createDocument($namespaceURI, $qualifiedName, $doctype) {
}
public function getFeature($feature, $version) {
}
}
class DomNode {
public $nodeName; // readonly
public $nodeValue;
public $nodeType; // readonly
public $parentNode; // readonly
public $childNodes; // readonly, Type: nodelist
public $firstChild; // readonly
public $lastChild; // readonly
public $previousSibling; // readonly
public $nextSibling; // readonly
public $attributes; // readonly, Type: namednodemap
public $ownerDocument; // readonly
public $namespaceURI; // readonly
public $prefix;
public $localName; // readonly
public $baseURI; // readonly
public $textContent;
public function insertBefore($newChild, $refChild) {
return $newChild;
}
public function replaceChild($newChild, $oldChild) {
return $oldChild;
}
public function removeChild($oldChild) {
return $oldChild;
}
public function appendChild($newChild) {
return $newChild;
}
public function hasChildNodes() {
return FALSE;
}
public function cloneNode($deep = FALSE) { // is it really FALSE??
return $cloneObj;
}
public function normalize() {
}
public function isSupported($feature, $version) {
return FALSE;
}
public function hasAttributes() {
return FALSE;
}
public function compareDocumentPosition($otherNode) {
// not yet implemented
}
public function isSameNode($otherNode) {
return FALSE;
}
public function lookupPrefix($namespaceURI) {
return $prefix;
}
public function isDefaultNamespace($namespaceURI) {
return FALSE;
}
public function lookupNamespaceUri($prefix) {
return $namespaceURI;
}
public function isEqualNode($otherNode) {
// not yet implemented
}
public function getFeature($feature, $version) {
// not yet implemented
}
public function setUserData($key, $data, $handler) {
// not yet implemented
}
public function getUserData($key) {
// not yet implemented
}
}
class DomNamespaceNode {
// no documentation available
}
class DomDocumentFragment extends DomNode {
public function DomDocumentFragment() {
}
}
class DomDocument extends DomNode {
public $doctype; // readonly
public $implementation; // readonly
public $documentElement; // readonly
public $actualEncoding; // readonly, W3C: inputEncoding
public $encoding; // Type: String, has to be proper Enctype, W3C:
xmlEncoding
public $standalone; // Type: Boolean, W3C: xmlStandalone
public $version; // W3C: xmlVersion
public $strictErrorChecking = TRUE;
public $formatOutput; // Type: Boolean, W3C: ??
public $validateOnParse; // Type: Boolean, W3C: ??
public $resolveExternals; // Type: Boolean, W3C: ??
public $preserveWhiteSpace; // Type: Boolean, W3C: ??
public $substituteEntities; // Type: Boolean, W3C: ??
public $documentURI;
public $config; // readonly, Type: DomConfiguration, W3C: domConfig
public function __construct($version = "1.0", $encoding = "") {
return $doc;
}
public function DomDocument($version = "1.0", $encoding = "") {
return $doc;
}
public function createElement($tagName, $data = "") {
return $newElement;
}
public function createDocumentFragment() {
return $newDocumentFragment;
}
public function createTextNode($data) {
return $newTextNode;
}
public function creatDommment($data) {
return $newComment;
}
public function createCDATASection($data) {
return $newCDATASection;
}
public function createProcessingInstruction($target, $data = "") {
return $newProcessingInstruction;
}
public function createAttribute($name) {
return $newAttribute;
}
public function createEntityReference($name) {
return $newEntityReference;
}
public function getElementsByTagname($tagName) {
return $domNodeList;
}
public function importNode($importedNode, $deep = FALSE) {
return $importedNode;
}
public function createElementNS($namespaceURI, $qualifiedName) {
return $newElementNS;
}
public function createAttributeNS($namespaceURI, $qualifiedName) {
return $newAttributeNS;
}
public function getElementsByTagNameNS($namespaceURI, $localName) {
return $domNodeList;
}
public function getElementById($elementId) {
return $foundElement;
}
public function adoptNode($sourceNode) {
// not yet implemented
}
public function normalizeDocument () {
}
public function renameNode($node, $namespaceURI, $qualifiedName) {
// not yet implemented
}
// ?? i'm not sure about the following methods, sorry
public function load($sourceFilename) {
// static call
return $parsedDoc;
// nonstatic call
return FALSE;
}
public function save($filename) {
return $bytesWritten; // or FALSE
}
public function loadXML($sourcDomde) {
// static call
return $parsedDoc;
// nonstatic call
return FALSE;
}
public function saveXML($node = FALSE) {
return $xmlCode; // or FALSE
}
public function validate() {
return FALSE;
}
public function xinclude() {
return FALSE;
}
public function loadHTML($sourcDomde) {
// static call
return $parsedDoc;
// nonstatic call
return FALSE;
}
public function loadHTMLFile($sourceFilename) {
// static call
return $parsedDoc;
// nonstatic call
return FALSE;
}
public function saveHTML() {
return $htmlCode;
}
public function saveHTMLFile($filename) {
return $bytesWritten; // or FALSE
}
public function schemaValidate($sourceFilename) {
return FALSE;
}
public function schemaValidateSource($sourcDomde) {
return FALSE;
}
public function relaxNGValidate($sourceFilename) {
return FALSE;
}
public function relaxNGValidateSource($sourcDomde) {
return FALSE;
}
}
class DomNodelist {
public $length = 0; // readonly
public function item($index) {
return $itemNode;
}
}
class DomNamedNodeMap {
public $length = 0; // readonly
public function getNamedItem($name) {
return $itemNode;
}
public function setNamedItem($node) {
// not yet implemented
}
public function removeNamedItem($name) {
// not yet implemented
}
public function item($index) {
return $itemNode;
}
public function getNamedItemNS($namespaceURI, $localName) {
return $itemNode;
}
public function setNamedItemNS($node) {
// not yet implemented
}
public function removeNamedItemNS($namespaceURI, $localName) {
// not yet implemented
}
}
class DomCharacterData extends DomNode {
public $data;
public $length = 0; // readonly
public function substringData($offset, $count) {
return $dataPart;
}
public function appendData($data) {
return TRUE; // W3C: void is returned
}
public function insertData($offset, $data) {
return TRUE; // W3C: void is returned
}
public function deleteData($offset, $count) {
return TRUE; // W3C: void is returned
}
public function replaceData($offset, $count, $data) {
return TRUE; // W3C: void is returned
}
}
class DomAttr extends DomNode {
public $name; // readonly
public $specified; // readonly, Type: Boolean, [TODO]
public $value;
public $ownerElement; // readonly, Type: DomElement
public $schemaTypeInfo; // readonly, [TODO]
public function __construct($name, $value = "") {
return $attrNode;
}
public function DomAttr($name, $value = "") {
return $attrNode;
}
public function isId() {
return FALSE;
}
}
class DomElement extends DomNode {
public $tagName; // readonly
public $schemaTypeInfo; // readonly, [TODO]
public function __construct($tagName, $value = "") {
return $elementNode;
}
public function DomElement($tagName, $value = "") {
return $elementNode;
}
public function getAttribute($name) {
return $value;
}
public function setAttribute($name, $value) {
}
public function removeAttribute($name) {
}
public function getAttributeNode($name) {
return $attrNode;
}
public function setAttributeNode($newAttr) {
return $newAttr;
}
public function removeAttributeNode($oldAttr) {
return $oldAttr;
}
public function getElementsByTagName($name) {
return $domNodeList;
}
public function getAttributeNS($namespaceURI, $localName) {
return $value;
}
public function setAttributeNS($namespaceURI, $localName, $value) {
}
public function removeAttributeNS($namespaceURI, $localName) {
}
public function getAttributeNodeNS($namespaceURI, $localName) {
return $domAttr;
}
public function setAttributeNodeNS($newAttr) {
return $newAttr;
}
public function getElementsByTagNameNS($namespaceURI, $localName) {
return $domNodeList;
}
public function hasAttribute($name) {
return FALSE;
}
public function hasAttributeNS($namespaceURI, $localName) {
return FALSE;
}
public function setIdAttribute($name, $isId) {
// not yet implemented
}
public function setIdAttributeNS($namespaceURI, $localName, $isId) {
// not yet immplemented
}
public function setIdAttributeNode($idAttr, $isId) {
// not yet implemented
}
}
class DomText extends DomCharacterData {
public $wholeText; // readonly
public function __construct($value = "") {
return $textNode;
}
public function DomText($value = "") {
return $textNode;
}
public function splitText($offset) {
return $domText;
}
public function isWhiteSpaceInElementContent() {
return FALSE;
}
public function replaceWholeText($content) {
// not yet implemented
}
}
class DomComment extends DomCharacterData {
public function __construct($value = "") {
return $commentNode;
}
public function DomComment($value = "") {
return $commentNode;
}
}
class DomTypeInfo {
// not yet implemented
public $typeName; // readonly, [TODO]
public $typeNamespace; // readonly, [TODO]
}
class DomUserDataHandler {
// not yet implemented
public function handle($operation, $key, $data, $source, $destination) {
// not yet implemented
}
}
class DomError {
// not yet implemented
public $severity; // readonly, [TODO]
public $message; // readonly, [TODO]
public $type; // readonly, [TODO]
public $relatedExeption; // readonly, Type: Exception, [TODO]
public $relatedData; // readonly, Type: DomNode, [TODO]
public $location; // readonly, Type: DomLocator, [TODO]
}
class DomErrorHandler {
// not yet implemented
public function handleError($error) {
// not yet implemented
}
}
class DomLocator {
// not yet implemented
public $lineNumber; // readonly, [TODO]
public $columnNumber; // readonly, [TODO]
public $offset; // readonly, [TODO]
public $relatedNode; // readonly, Type: DomNode, [TODO]
public $uri; // readonly, [TODO]
}
class DomConfiguration {
// not yet implemented
public function setParameter($name, $value) {
// not yet implemented
}
public function getParameter($name) {
// not yet implemented
}
public function canSetParameter($name, $value) {
// not yet implemented
}
}
class DomCDATASection extends DomText {
public function __construct($value) {
return $cdataSectionNode;
}
public function DomCDATASection($value) { // [FIXME] originally named
'"DomCDATASection"' including quotes!
return $cdataSectionNode;
}
}
class DomDocumentType extends DomNode {
// not yet implemented
public $name; // readonly
public $entities; // readonly, Type: DomNamedNodeMap
public $notations; // readonly, Type: DomNamedNodeMap
public $publicId; // readonly
public $systemId; // readonly
public $internalSubset; // readonly
}
class DomNotation extends DomNode { // [FIXME] It doesn't really inherits
methods of DomNode as documented in source code
// not yet implemented
public $publicId; // readonly
public $systemId; // readonly
}
class DomEntity extends DomNode {
// not yet implemented
public $publicId; // readonly
public $systemId; // readonly
public $notationName; // readonly
public $actualEncoding; // [TODO]
public $encoding; // [TODO]
public $version; // [TODO]
}
class DomEntityReference extends DomNode {
public function __construct($name) {
return $domEntityReferenceNode;
}
public function DomEntityReference($name) {
return $domEntityReferenceNode;
}
}
class DomProcessingInstruction extends DomNode {
public $target; // readonly
public $data;
public function __construct($target, $data = "") {
return $domProcessingInstructionNode;
}
public function DomProcessingInstruction($target, $data = "") { // [FIXME]
originally named '"DomCDATASection"' including quotes!
return $domProcessingInstructionNode;
}
}
class DomString_extend {
// not yet implemented
public function findOffset16($offset16) {
// not yet implemented
}
public function findOffset32($offset32) {
// not yet implemented
}
}
class DomXPath {
public function __construct($doc) {
return $domXPath;
}
public function DomXPath($doc) {
return $domXPath;
}
public function register_namespace($prefix, $uri) {
return FALSE;
}
public function query($expression, $context = FALSE) {
return $domNodeList;
}
}
?>