Class Element

Node
  |
  +--Element

public class Element
extends Node

Class representing the DOM Element interface.


Field Summary
private  string $tagName
          The XML tag name.
DOM-Level 1
 
Fields inherited from class Node
$attributes, $childNodes, $firstChild, $lastChild, $localName, $namespaceURI, $nextSibling, $nodeID, $nodeName, $nodeType, $nodeValue, $ownerDocument, $parentNode, $prefix, $previousSibling, $readonly
 
Constructor Summary
Element()
          Constructor of the class.
 
Method Summary
 string getAttribute(var $name)
          Returns the value of the attribute specified by the name parameter.
DOM-Level 1
 Attr getAttributeNode(var $name)
          Returns the attribute specified by the name parameter.
DOM-Level 1
 Attr getAttributeNodeNS(var $namespaceURI, var $localName)
          Same as getAttributeNode, but includes support for XML namespaces.
DOM-Level 2
 string getAttributeNS(var $namespaceURI, var $localName)
          Same as getAttribute, but includes support for XML namespaces.
DOM-Level 2
 NodeList getElementsByTagName(var $name)
          Returns a NodeList of all child Element nodes whose tagName attribute matches the give name parameter.
DOM-Level 1
private  void getElementsByTagNameList(var $tagName, var $parent, var $result)
          Runs recursively through the DOM-Tree and returns a NodeList with all Element nodes that have the searched tagname.
 NodeList getElementsByTagNameNS(var $namespaceURI, var $localName)
          Same as getElementsByTagName, but includes support for XML namespaces.
DOM-Level 2
private  void getElementsByTagNameNSList(var $namespaceURI, var $localName, var $parent, var $result)
          Runs recursively through the DOM-Tree and returns a NodeList with all Element nodes that have the searched $namespaceURI and $localName.
 string getTagName()
          Returns the XML tag name of the element.
DOM-Level 1
 boolean hasAttribute(var $name)
          Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise.
 boolean hasAttributeNS(var $namespaceURI, var $localName)
          Same as hasAttribute, but includes support for XML namespaces.
DOM-Level 2
 void removeAttribute(var $name)
          Removes the Attribute node specified by name.
DOM-Level 1
 Attr removeAttributeNode(var $oldAttr)
          Removes the specified Attribute node.
DOM-Level 1
 void removeAttributeNS(var $namespaceURI, var $localName)
          Same as removeAttribute, but includes support for XML namespaces.
DOM-Level 2
 void setAttribute(var $name, var $value)
          Set the Attribute name to the value.
 Attr setAttributeNode(var $newAttr)
          Sets the specified Attribute node.
DOM-Level 1
 Attr setAttributeNodeNS(var $newAttr)
          Same as setAttributeNode, but includes support for XML namespaces.
DOM-Level 2
 void setAttributeNS(var $namespaceURI, var $qualifiedName, var $value)
          Same as setAttribute, but includes support for XML namespaces.
DOM-Level 2
 
Methods inherited from class Node
appendChild, checkDocument, checkHierarchy, cloneNode, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Field Detail

$tagName

private string $tagName
The XML tag name.
DOM-Level 1
Constructor Detail

Element

public Element()
Constructor of the class.
Method Detail

getTagName

public string getTagName()
Returns the XML tag name of the element.
DOM-Level 1

getAttribute

public string getAttribute(var $name)
Returns the value of the attribute specified by the name parameter.
DOM-Level 1
Parameters:
$name - string

getAttributeNode

public Attr getAttributeNode(var $name)
Returns the attribute specified by the name parameter.
DOM-Level 1
Parameters:
$name - string

getElementsByTagName

public NodeList getElementsByTagName(var $name)
Returns a NodeList of all child Element nodes whose tagName attribute matches the give name parameter.
DOM-Level 1
Parameters:
$name - string

removeAttribute

public void removeAttribute(var $name)
Removes the Attribute node specified by name.
DOM-Level 1
Parameters:
$name - string

removeAttributeNode

public Attr removeAttributeNode(var $oldAttr)
Removes the specified Attribute node.
DOM-Level 1
Parameters:
$oldAttr - Attr
$oldAttr - is passed by reference

setAttribute

public void setAttribute(var $name,
                         var $value)
Set the Attribute name to the value. If the node does not exist, it is created.
DOM-Level 1
Parameters:
$name - string
$value - string

setAttributeNode

public Attr setAttributeNode(var $newAttr)
Sets the specified Attribute node.
DOM-Level 1
Parameters:
$newAttr - Attr
$newAttr - is passed by reference

getAttributeNS

public string getAttributeNS(var $namespaceURI,
                             var $localName)
Same as getAttribute, but includes support for XML namespaces.
DOM-Level 2
Parameters:
$namespaceURI - string
$localName - string

getAttributeNodeNS

public Attr getAttributeNodeNS(var $namespaceURI,
                               var $localName)
Same as getAttributeNode, but includes support for XML namespaces.
DOM-Level 2
Parameters:
$namespaceURI - string
$localName - string

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(var $namespaceURI,
                                       var $localName)
Same as getElementsByTagName, but includes support for XML namespaces.
DOM-Level 2
Parameters:
$namespaceURI - string
$localName - string

hasAttribute

public boolean hasAttribute(var $name)
Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise.
DOM-Level 2
Parameters:
$name - string

hasAttributeNS

public boolean hasAttributeNS(var $namespaceURI,
                              var $localName)
Same as hasAttribute, but includes support for XML namespaces.
DOM-Level 2
Parameters:
$namespaceURI - string
$localName - string

removeAttributeNS

public void removeAttributeNS(var $namespaceURI,
                              var $localName)
Same as removeAttribute, but includes support for XML namespaces.
DOM-Level 2
Parameters:
$namespaceURI - string
$localName - string

setAttributeNS

public void setAttributeNS(var $namespaceURI,
                           var $qualifiedName,
                           var $value)
Same as setAttribute, but includes support for XML namespaces.
DOM-Level 2
Parameters:
$namespaceURI - string
$localName - string

setAttributeNodeNS

public Attr setAttributeNodeNS(var $newAttr)
Same as setAttributeNode, but includes support for XML namespaces.
DOM-Level 2
Parameters:
$newAttr - Attr
$newAttr - is passed by reference

getElementsByTagNameList

private void getElementsByTagNameList(var $tagName,
                                      var $parent,
                                      var $result)
Runs recursively through the DOM-Tree and returns a NodeList with all Element nodes that have the searched tagname.
Parameters:
$tagName - string
$parent - Node
$result - NodeList
$parent - is passed by reference
$result - is passed by reference

getElementsByTagNameNSList

private void getElementsByTagNameNSList(var $namespaceURI,
                                        var $localName,
                                        var $parent,
                                        var $result)
Runs recursively through the DOM-Tree and returns a NodeList with all Element nodes that have the searched $namespaceURI and $localName.
Parameters:
$namespaceURI - string
$localName - string
$parent - Node
$result - NodeList
$parent - is passed by reference
$result - is passed by reference