phpDocumentor SAFOX
SAFOX_G
[ class tree: SAFOX ] [ index: SAFOX ] [ all elements ]

Class: xmlNode

Source Location: /safox_g.cls.php

Class xmlNode

Class Overview

class xmlNode

Changes History : See File Information for changes

Located in /safox_g.cls.php [line 545]



		
				Author(s):
		
  • CVH, cpi-service; cvh@cpi-service.com
Information Tags:
License:  GNU
Version:  0.5

Properties

Methods

[ Top ]
Property Summary
mixed   $EntityConversion   EntityConversion - flag used to determine whether or not special characters in CDATA should be converted into HT/XML-Entities (e.g.

[ Top ]
Method Summary
void   xmlNode()   Constructor
reference   &addNode()   addNode - Adds a child node to the current Object (Node) and returns a reference to childNode
xmlnode   &addNodeAfter()   Adds a new Node to the Node directly *after* a specified ChildNode, whereas addNode() method adds a node to the end of the Node
xmlnode   &addNodeBefore()   Adds a new Node to the Node directly *before* a specified ChildNode, whereas addNode() method adds a node to the end of the Node
void   cleanUp()   Cleans up internal data arrays from removed nodes and rebuilts the ID Referencing Array
string   convertString2Entities()   convertString2Entities - returns a string that represents a well formed xml-string to be used as CDATA based on setEntityConversion() converts the parameter into into HT/XML-Entities or encapsulates in <![CDATA[]]>
void   delete()   Alias to destroy - Deletes a node and all childnodes, if the optional parameter clean is set true (default), a call to the cleanUp Method of the XMLDOC Object is made automatically.
void   destroy()   Deletes a node and all childnodes, if the optional parameter clean is set true (default), a call to the cleanUp Method of the XMLDOC Object is made automatically.
mixed   getAttribute()   getAttribute returns the value of an attribute
unknown   getCData()   setCData - returns the CData content of a node
direct   &getChildNodeByTagName()   getChildNodeByTagName - returns a reference to specific ChildNode of current Node -- suggested by Cristiano
direct   &getChildNodeByType()   alias to getChildNodeByTagName - returns a reference to specific ChildNode of current Node -- suggested by Cristiano
mixed   getId()   getId -- return the Unique ID attribute value
reference   &getNextNode()   getNextNode - returns a reference to the Next ChildNode of current Node
reference   &getParent()   getParent - Returns a reference to the Parent NodeObject or null
string   getType()   getType returns the type/TagName of a xml node
boolean   hasChildren()   hasChildren - Returns true if childNodes exist or false
boolean   hasParent()   hasParent - Returns true if a reference to a parent node exists
void   remove()   Alias to destroy - Deletes a node and all childnodes, if the optional parameter clean is set true (default), a call to the cleanUp Method of the XMLDOC Object is made automatically.
void   setAttribute()   setAttribute sets an Attribute
void   setCData()   setCData - sets the CData content of a node
-   setEntityConversion()   setEntityConversion is a function that specifies whether or not special characters in CDATA should be converted into HT/XML-Entities (e.g.
void   setId()   setId sets the Unique ID Attribute defined by xmlDoc->setUida or "ID"
void   setParent()   setParent - Sets the ParentNode (usually used internally or if moved)
void   setType()   setType Sets the type of a xml node/tag
string   writeXML()   returns a string containing the wellformed xml of current Node/tag

[ Top ]
Properties
mixed   $EntityConversion = true [line 600]

EntityConversion - flag used to determine whether or not special characters in CDATA should be converted into HT/XML-Entities (e.g.

& into &amp;, ' into &apos; ...) (true) or enclosed into CDATA tags (false) added 20060125


[ Top ]
Methods
Constructor xmlNode  [line 612]

  void xmlNode( [$type $type = "DATA"], $doc &$doc  )

Constructor

Parameters:
$type   $type: 
$doc   &$doc: 


[ Top ]
addNode  [line 765]

  reference &addNode( $type $type, [mixed $id = ""false]  )

addNode - Adds a child node to the current Object (Node) and returns a reference to childNode

Parameters:
$type   $type:  -- Type of tag/Node

API Tags:
Return:  to xmlnode just created


[ Top ]
addNodeAfter  [line 786]

  xmlnode &addNodeAfter( $nodeBefore &$nodeBefore, [$nodeTypetyp $nodeType = "DATA"], [$id $id = false]  )

Adds a new Node to the Node directly *after* a specified ChildNode, whereas addNode() method adds a node to the end of the Node

Parameters:
$nodeBefore   &$nodeBefore: 
  • xmlreference to the Node
$nodeTypetyp   $nodeType:  or TagName of of node to be created e.g. "product" for <product>
$id   $id:  sets a value for the uida (unique ID attribute)

API Tags:
Return:  reference to xmlNode Object or false of referenced Node $nodeBefore was not found or Parent Node empty


[ Top ]
addNodeBefore  [line 839]

  xmlnode &addNodeBefore( $nodeBefore &$nodeAfter, [$nodeTypetyp $nodeType = "DATA"], [$id $id = false]  )

Adds a new Node to the Node directly *before* a specified ChildNode, whereas addNode() method adds a node to the end of the Node

Parameters:
$nodeBefore   &$nodeAfter: 
  • xmlreference to the Node
$nodeTypetyp   $nodeType:  or TagName of of node to be created e.g. "product" for <product>
$id   $id:  sets a value for the uida (unique ID attribute)

API Tags:
Return:  reference to xmlNode Object or false of referenced Node $nodeBefore was not found or Parent Node empty


[ Top ]
cleanUp  [line 915]

  void cleanUp( )

Cleans up internal data arrays from removed nodes and rebuilts the ID Referencing Array

This method should not be called directly Instead call the CleanUp method of the parenting XMLDOC Object after removing nodes from the document, This function need not be called if node->destroy(clean) is called with optional parameter clean = true (default) When removing more than one node it is faster to call node->destroy(clean)with parameter clean set to false and calling xmlDoc->cleanUp() after making all removals



[ Top ]
convertString2Entities  [line 980]

  string convertString2Entities( string $string  )

convertString2Entities - returns a string that represents a well formed xml-string to be used as CDATA based on setEntityConversion() converts the parameter into into HT/XML-Entities or encapsulates in <![CDATA[]]>

Parameters:
string   $string: 


[ Top ]
delete  [line 936]

  void delete( [$clean $clean = true]  )

Alias to destroy - Deletes a node and all childnodes, if the optional parameter clean is set true (default), a call to the cleanUp Method of the XMLDOC Object is made automatically.

To enhance performance you may want to set clean to false if you are removing more than one node and call xmlDoc->cleanUp() afer these operations manually. Otherwise the cleanUp operation is called automatically everytime a call to destroy is made

Parameters:
$clean   $clean: 
  • boolean if set true deletes child-nodes recursively and resets the internal arrays if this


[ Top ]
destroy  [line 960]

  void destroy( [$clean $clean = true]  )

Deletes a node and all childnodes, if the optional parameter clean is set true (default), a call to the cleanUp Method of the XMLDOC Object is made automatically.

To enhance performance you may want to set clean to false if you are removing more than one node and call xmlDoc->cleanUp() afer these operations manually. Otherwise the cleanUp operation is called automatically everytime a call to destroy is made

Parameters:
$clean   $clean: 
  • boolean if set true deletes child-nodes recursively and resets the internal arrays if this


[ Top ]
getAttribute  [line 662]

  mixed getAttribute( $attribute $attribute  )

getAttribute returns the value of an attribute

Parameters:
$attribute   $attribute: 
  • string name of attribute

API Tags:
Return:  unknown or boolean


[ Top ]
getCData  [line 677]

  unknown getCData( )

setCData - returns the CData content of a node



[ Top ]
getChildNodeByTagName  [line 729]

  direct &getChildNodeByTagName( string $tagName  )

getChildNodeByTagName - returns a reference to specific ChildNode of current Node -- suggested by Cristiano

Parameters:
string   $tagName:  -- node's tagname to return

API Tags:
Return:  reference to xmlNode Object if only one tag found, array of xmlNode Object references if more found, or boolean false


[ Top ]
getChildNodeByType  [line 720]

  direct &getChildNodeByType( mixed $type, string $tagName  )

alias to getChildNodeByTagName - returns a reference to specific ChildNode of current Node -- suggested by Cristiano

Parameters:
string   $tagName:  -- node's tagname to return

API Tags:
Return:  reference to xmlNode Object if only one tag found, array of xmlNode Object references if more found, or boolean false


[ Top ]
getId  [line 684]

  mixed getId( )

getId -- return the Unique ID attribute value


API Tags:
Return:  string or int UIDA value of the node (or internal value)


[ Top ]
getNextNode  [line 692]

  reference &getNextNode( [optional $step = 1]  )

getNextNode - returns a reference to the Next ChildNode of current Node

Parameters:
optional   $step:  -- defines step and direction (+1 = next, -1 = previos etc.)

API Tags:
Return:  to xmlNode Object or boolean false


[ Top ]
getParent  [line 755]

  reference &getParent( )

getParent - Returns a reference to the Parent NodeObject or null


API Tags:
Return:  to parent node or boolean false


[ Top ]
getType  [line 630]

  string getType( )

getType returns the type/TagName of a xml node


API Tags:
Return:  type/TagName of a xml node


[ Top ]
hasChildren  [line 901]

  boolean hasChildren( )

hasChildren - Returns true if childNodes exist or false


API Tags:
Return:  true or false


[ Top ]
hasParent  [line 748]

  boolean hasParent( )

hasParent - Returns true if a reference to a parent node exists


API Tags:
Return:  true or false


[ Top ]
remove  [line 948]

  void remove( [$clean $clean = true]  )

Alias to destroy - Deletes a node and all childnodes, if the optional parameter clean is set true (default), a call to the cleanUp Method of the XMLDOC Object is made automatically.

To enhance performance you may want to set clean to false if you are removing more than one node and call xmlDoc->cleanUp() afer these operations manually. Otherwise the cleanUp operation is called automatically everytime a call to destroy is made

Parameters:
$clean   $clean: 
  • boolean if set true deletes child-nodes recursively and resets the internal arrays if this


[ Top ]
setAttribute  [line 654]

  void setAttribute( $attribute $attribute, $value $value  )

setAttribute sets an Attribute

Parameters:
$attribute   $attribute: 
  • name of an attribute
$value   $value: 
  • string or int - Value to be set


[ Top ]
setCData  [line 670]

  void setCData( $string $string  )

setCData - sets the CData content of a node

Parameters:
$string   $string: 
  • string value of content to be set


[ Top ]
setEntityConversion  [line 1000]

  - setEntityConversion( [bool $bool = true]  )

setEntityConversion is a function that specifies whether or not special characters in CDATA should be converted into HT/XML-Entities (e.g.

& into &amp;, ' into &apos; ...) (true) or enclosed into CDATA tags (false) added 20060125

Parameters:
bool   $bool:  boolean

API Tags:
Return:  nothing


[ Top ]
setId  [line 638]

  void setId( $id $id  )

setId sets the Unique ID Attribute defined by xmlDoc->setUida or "ID"

Parameters:
$id   $id: 
  • mixed string or int that uniquely identifies the node


[ Top ]
setParent  [line 892]

  void setParent( $node &$node  )

setParent - Sets the ParentNode (usually used internally or if moved)

Parameters:
$node   &$node: 
  • reference to ParentNode


[ Top ]
setType  [line 623]

  void setType( $type $type  )

setType Sets the type of a xml node/tag

Parameters:
$type   $type:  string of tagname/typ of node e.g. "product" for <product>


[ Top ]
writeXML  [line 1007]

  string writeXML( )

returns a string containing the wellformed xml of current Node/tag


API Tags:
Return:  XML NODE string


[ Top ]

Documentation generated on Thu, 9 Feb 2006 13:55:10 +0100 by phpDocumentor 1.3.0RC3