Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /usr/local/apache_8080/htdocs/devel/Intra/class/phpdom/domxml_element.php
Document Object Model for PHP - phpDOM

Element

Node
   |
  +-- Element

The Element-Class

 

private class Element extends Node

The Element-Class
Base Class for all Element Nodes in a DOM Tree (XML_ELEMENT_NODE == 1)Nearly all nodes in a tree are element nodes. If you have the followingXML document<library language="php">..<package name="phpDOM" state="devel" platform="Unix">....<class>Node</class>....<class>Document</class>..</package>..<package name="phpDOM.XHTML" state="devel" platform="Unix"/>..<package name="phpDOM.ref" state="devel" platform="WinNT"/></library>The document has a root element "library" and defines sub-elements, packages. All elementsmay have attributes and children. If an element does not have any children, theopening tag can be closed by a "/>" and the closing tag can be omitted.

AuthorsDietmar Glachs <dietmar.glachs@salzburgresearch.at>
Versiondevel.0.4
Copyright2000 Salzburg Research Gesellschaft m.b.H.

 
Direct known subclasses: HTMLElement

Methods inherited from Node

Node, Tag, appendChild, cloneNode, removeChild, getOwnerDocument, getFirstChild, getNextChild, getLastChild, getNodeById, hasChildNodes, hasMoreElements, getParentNode, getParent, getChildNodes, setNodeValue, getNodeValue, getAttributes, toString, getNodeName, getNodeType, addElement, _internal_toString, _internal_cloneNode, _internal_selfCheck, _internal_getNodeById

Public Method Summary

object Element

getElementById(string $IdToSearch)

getElementById
object NodeList

getElementsByTagName(string $NameToSearch)

getElementsByTagName
boolean

setAttribute(string $attr, string $value)

setAttribute set/changes an attribute of the current element.
boolean

setName(string $name)

setName sets the Name attribute of the current node
boolean

setId(string $id)

setId sets the ID attribute of the current node
string

getName()

getName returns the name attribute of the current node
string

getId()

getId liefert das getId-Attribut, ruft $this->getAttribute auf.
string

getAttribute(string $attr)

getAttribute returns the value of the named attribute or false if not set

Private Method Summary

void

Element([ string $tag, string $content ])

Element Constructor of the Element node
string

getTagName()

getTagName retrieves the name of the element
object DomNode

_internal_getElementById(object DomNode $search, string $IdToSearch)

_internal_getElementById
object DomNode

_internal_getElementsByTagName(object DomNode $search, string $NameToSearch, array &$AppendArray)

_internal_getElementsByTagName

Fields inherited from Node

$nodeName, $nodevalue, $attribute, $node

Private Field Summary

string

$tagName

The Name of the Node.

Public Method Details

getElementById

public object Element getElementById( string $IdToSearch )

  getElementById
parses the children of the current node for a node with a given "id" attribute.If such a node can be found, the object will be returned, false otherwise.

Parameter
string $IdToSearch
Returns object Element $ElementWithId


getElementsByTagName

public object NodeList getElementsByTagName( string $NameToSearch )

  getElementsByTagName
parses the tree of the current node for all node with the given name.

Parameter
string $NameToSearch
Returns object NodeList

An list with all objects found will be returned!


setAttribute

public boolean setAttribute( string $attr, string $value )

  setAttribute set/changes an attribute of the current element.

Parameter
string $attr
name of the attribute
string $value
value of the attribute
Returns boolean

true


setName

public boolean setName( string $name )

  setName sets the Name attribute of the current node
Setting the name attribute is different from setting thename of the node!Example: <nodename name="nameattribute"/>

Parameter
string $name
name attribute
Returns boolean

true

See Also Element::setAttribute()

setId

public boolean setId( string $id )

  setId sets the ID attribute of the current node

Parameter
string $id
id attribute
Returns boolean

true

See Also Element::setAttribute()

getName

public string getName( )

  getName returns the name attribute of the current node

Returns string

the name attribute

See Also Element::getAttribute()

getId

public string getId( )

  getId liefert das getId-Attribut, ruft $this->getAttribute auf.

Returns string $id

See Also Element::getAttribute()

getAttribute

public string getAttribute( string $attr )

  getAttribute returns the value of the named attribute or false if not set

Parameter
string $attr
Returns string $value


Private Method Details

Element

private void Element( [ string $tag, string $content ] )

  Element Constructor of the Element node

Parameter
string $tag = >>""<<
of the elment node
string $content = >>""<<
, the content of the element node
Returns void


getTagName

private string getTagName( )

  getTagName retrieves the name of the element

Returns string $tagName


_internal_getElementById

private object DomNode _internal_getElementById( object DomNode $search, string $IdToSearch )

  _internal_getElementById
This private functions performs the recursive scan through all child nodes for thecurrent node. This functions deals with >>DomNode<< Objects.

Parameter
object DomNode $search
string $IdToSearch
of the node to be retrieved
Returns object DomNode

The first node with the given id, false if not found!

Magic This function works with >> DomNode << objects, never use directly.
See Also Element::getElementById()

_internal_getElementsByTagName

private object DomNode _internal_getElementsByTagName( object DomNode $search, string $NameToSearch, array &$AppendArray )

  _internal_getElementsByTagName
This private functions performs the recursive scan through all child nodes for thecurrent node. This functions deals with >>DomNode<< Objects.

Parameter
object DomNode $search
string $NameToSearch
of the node to be retrieved
array &$AppendArray
to append all nodes with the given tag name.
Returns object DomNode

The first node with the given name, false if not found!

Magic This function deals with >>DomNode<< objects. Never use this function directly.

Private Field Details

$tagName

private string $tagName

>>""<<

The Name of the Node.
The Name of the Node will be used as the tag enclosed in <tagName attrlist>



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta