|
|
|
File: /usr/local/apache_8080/htdocs/devel/Intra/class/phpdom/domxml_document.php
Document Object Model for PHP - phpDOM
Document
Node | +-- Document
The Document-Class
|
private class Document extends Node
The Document-Class
This is the base class for all dom documents (XML, XHTML, WML ...)
|
| |
|
Direct known subclasses: HTMLDocument
|
|
Methods inherited from Node |
| Node, Tag, appendChild, cloneNode, removeChild, getOwnerDocument, getFirstChild, getNextChild, getLastChild, getNodeById, hasChildNodes, hasMoreElements, getParentNode, getParent, getChildNodes, setNodeValue, getNodeValue, getAttributes, getNodeName, getNodeType, addElement, _internal_toString, _internal_cloneNode, _internal_selfCheck, _internal_getNodeById |
|
|
|
|
|
|
|
Private Field Summary |
| string |
$doctypeStores the type of the document! Currently not used! |
| object DomDocument |
$documentStores the link to the document document itself |
| object Element |
$documentElementStores the root of the document |
|
Public Method Details |
getRoot |
|
public object Element getRoot( )
|
| |
getRoot returns the document root element
returns the document root. An object of type Element will be returned.
|
| Returns |
object Element |
| Deprecated |
Use getDocumentElement() instead |
| See Also |
getDocumentElement() |
|
setRoot |
|
public object Element setRoot( object Element &$root )
|
| |
setRoot same as setDocumentElement()
returns the document root. An object of type Element will be returned.
|
| Parameter |
|
| object Element |
&$root |
|
|
The new root element of the document! |
|
| Returns |
object Element |
| Deprecated |
Use setDocumentElement() instead |
| See Also |
setDocumentElement() |
|
getElementsByTagName |
|
public object NodeList getElementsByTagName( string $NameToSearch )
|
| |
getElementsByTagName returns a NodeList of all the elements with a given tag name
Returns a NodeList of all the Elements with a giventag name in the order in which they would be encountered in a preorder traversalof the Document tree.
|
| Parameter |
|
| string |
$NameToSearch |
|
|
The Name of the elements to collect and return. |
|
| Returns |
object NodeList |
|
|
Private Method Details |
create |
|
private object DomDocument create( string $root )
|
| |
create() creates an empty Document
This function creates an empty Document! This function mustbe redefined by inheriting classes to provide an appropriate skeletonfor the deriving classes.
|
| Parameter |
|
| string |
$root |
|
|
The name of the root element! |
|
| Returns |
object DomDocument |
|
createFromFile |
|
private object DomDocument createFromFile( string $url )
|
| |
createFromFile creates a Document by reading an existing file
The function creates the Document by reading the File from the specified url. If thedocument is not valid, the function returns false.
|
| Parameter |
|
|
| Returns |
object DomDocument |
|
createFromString |
|
private object DomDocument createFromString( string $xmldocument )
|
| |
createFromString creates a Document given in the string
The function creates the Document using the given string. If thedocument is not valid, the function returns false.
|
| Parameter |
|
|
| Returns |
object DomDocument |
|
setDocumentElement |
|
private object Element setDocumentElement( object Element &$Element )
|
| |
setDocumentElement sets the document root
The root element of the document will be set. If aSet the document root. If the root has existing child nodes they will be destroyed!
|
| Parameter |
|
| object Element |
&$Element |
|
|
The new document root element |
|
| Returns |
object Element |
|
getDocumentElement |
|
private object Element getDocumentElement( )
|
| |
getDocumentElement provides direct access to the root element of the document
returns the document root. An object of type Element will be returned.
|
| Returns |
object Element $root |
| Magic |
This i |
| See Also |
getRoot() |
|
getXPathContext |
|
private object XPath getXPathContext( )
|
| |
getXPathContext creates an instance of an XPath object linked to the current document.
returns an XPath object for searching the document with xpath-expressions.Usage:$xpo = $doc->getXPathContext( );$nlist = $xpo->eval( "//child::text()" );This example will retrieve all text nodes!
|
| Returns |
object XPath A new instance of the XPath object |
|
getDocType |
|
private void getDocType( )
|
| |
getDocType
currently does nothing
|
| Returns |
void |
|
getElementById |
|
private object Node getElementById( string $IdToSearch )
|
| |
getElementById
parses the document for a node with the given "id" attribute!
|
| Parameter |
|
|
| Returns |
object Node |
|
toString |
|
private string toString( )
|
| |
toString returns the entire document as string
returns the document as string
Warning: documentation is missing.
|
| Returns |
string $doc |
|
printDocument |
|
private void printDocument( )
|
| |
printDocument sends the entire document to the browser
|
| Returns |
void |
|
|
Private Field Details |
$doctype |
|
private string $doctype
>>""<<
Stores the type of the document! Currently not used!
|
|
$document |
|
private object DomDocument $document
>><<
Stores the link to the document document itself
|
|
$documentElement |
|
private object Element $documentElement
>><<
Stores the root of the document
|
|
|
|
|
|
| PHPDoc 1.0beta |