Class SimpleXMLElementExt

Description

This class extends the SimpleXMLElement class in PHP and adds a few extra methods to aid in the XML DOM manipulation.

Located in /class.simplexmlelementext.php (line 25)

SimpleXMLElement
   |
   --SimpleXMLElementExt
Method Summary
void addAttributeNS (string $sNS, string $sAttribute, string $sValue)
void addChildNode ( $oChild)
SimpleXMLElement getParent ()
bool hasChildNodes ()
void insertAfter (SimpleXMLElement $oNewNode, SimpleXMLElement $oRefNode)
void insertBefore (SimpleXMLElement $oNewNode, SimpleXMLElement $oRefNode)
void removeAttribute (string $sAttribute)
void removeAttributeNS (string $sNS, string $sAttribute)
void removeChild (SimpleXMLElement $oChild)
Methods
addAttributeNS (line 111)

Adds an attribute to the current node in the specified namespace.

  • access: public
void addAttributeNS (string $sNS, string $sAttribute, string $sValue)
  • string $sNS: The namespace that the new attribute belongs in
  • string $sAttribute: The attribute to add to the node
  • string $sValue: The value of the attribute to add to the node
addChildNode (line 34)

Adds a child SimpleXMLElement node as a child of this node. This differs from the native addChild() method in that it allows adding an XML node, not creating a tag.

  • access: public
void addChildNode ( $oChild)
  • SimpleXMLElement $oChild: The node to add as a child of this node
cloneNode (line 49)

Clones this node recursively and returns the cloned node.

  • return: A copy of the current node
  • access: public
SimpleXMLElementExt cloneNode ()
getParent (line 182)

Returns the parent node of the current SimpleXML node

  • return: The parent of this node
  • access: public
SimpleXMLElement getParent ()
hasChildNodes (line 169)

Determines if this SimpleXML node has children nodes

  • return: True if this node has children, false if it does not
  • access: public
bool hasChildNodes ()
insertAfter (line 150)

Inserts the specified new node after the specified existing node. These nodes must be children of the current SimpleXML element.

  • access: public
void insertAfter (SimpleXMLElement $oNewNode, SimpleXMLElement $oRefNode)
  • SimpleXMLElement $oNewNode: The new node to add to this nodes DOM
  • SimpleXMLElement $oRefNode: An existing child node in this nodes DOM that becomes the previous sibling of the new node.
insertBefore (line 128)

Inserts the specified new node before the specified existing node. These nodes must be children of the current SimpleXML element.

  • access: public
void insertBefore (SimpleXMLElement $oNewNode, SimpleXMLElement $oRefNode)
  • SimpleXMLElement $oNewNode: The new node to add to this nodes DOM
  • SimpleXMLElement $oRefNode: An existing child node in this nodes DOM that becomes the next sibling of the new node.
removeAttribute (line 95)

Remove an attribute from the current node. Note that if the attribute exists in a non- default namespace, removeAttributeNS() should be used.

  • access: public
void removeAttribute (string $sAttribute)
  • string $sAttribute: The attribute to remove
removeAttributeNS (line 80)

Remove an attribute in a particular namespace

  • access: public
void removeAttributeNS (string $sNS, string $sAttribute)
  • string $sNS: The namespace the attribute exists in
  • string $sAttribute: The name of the attribute to remove
removeChild (line 64)

Removes the specified child from the XML DOM

  • access: public
void removeChild (SimpleXMLElement $oChild)
  • SimpleXMLElement $oChild: The child node to remove from the parent DOM

Inherited Methods

Inherited From SimpleXMLElement (Internal Class)

constructor __construct ( )
addAttribute ( )
addChild ( )
asXML ( )
attributes ( )
children ( )
count ( )
getDocNamespaces ( )
getName ( )
getNamespaces ( )
registerXPathNamespace ( )
saveXML ( )
xpath ( )
__toString ( )

Documentation generated on Thu, 25 Feb 2010 15:59:41 -0500 by phpDocumentor 1.4.3