STPHPObject | --STPHPXmlDoc
Located in File: Program_Root/stphpxmldoc.php
stphplib
Roberto Gerola <roberto.gerola@speedtech.it>
0.8
Class Variable Summary |
$currentXMLElement
The current element of the tree Default Value:
|
$elementsRead
The array of already read elements Default Value:
|
$parentXMLElement
The parent XML node of the current node Default Value:
|
$parser
An instance of the parser Default Value:
|
$root
The root element of the tree Default Value:
|
$withCData
TRUE if the current tag has data Default Value:
|
Inherited Class Variable Summary | ||||||
Inherited From Class STPHPObject
|
Inherited Method Summary | ||||||||||
Inherited From Class STPHPObject
|
Variable Detail |
private
private
private
private
private
private
Method Detail |
STPHPXmlDoc constructor STPHPXmlDoc ( $name )
Creates the object- string $name:
public
void cdata ( $parser, $cdata )
The handler for parsing the data closing for XML- string $parser: An istance of the parser
- string $cdata: The read data
private
void defaultHandler ( $parser, $data )
The default handler for XML parsing- string $parser: An istance of the parser
- string $data: The read value
private
void deleteElementFromDb ( &$db, $element_id, $tableElements, $tableAttributes, $tableChilds )
Delete a single XML node from the db- Object &$db: A db pointer (AdoDb library)
- integer $element_id: The db's id of the node
- string $tableElements: The table that contains the elements
- string $tableAttributes: The table that contains the attributes
- string $tableChilds: The table that contains the childs
private
void deleteTreeFromDb ( &$db, $tableElements, [$rootTag = ''], [$tableAttributes = ''], [$tableChilds = ''] )
Delete a whole XML tree (an XML document) from the db- Object &$db: A db pointer (AdoDb library)
- string $tableElements: The table that contains the elements
- string $rootTag: The tag that represents the root of the document
- string $tableAttributes: The table that contains the attributes
- string $tableChilds: The table that contains the childs
public
void dtor ( )
Overrides: STPHPObject::dtor()
DestructorDestroys all the resources associated with the object
public
array getArrayElement ( &$element )
Returns a XML element as an array- STPHPXmlElement &$element:
public
array getSubTreeAsArray ( &$element )
Returns a portion of the XML tree as an array- STPHPXmlElement &$element:
public
array getTreeAsArray ( )
Returns a whole XML tree as an arraypublic
void loadElementFromDb ( &$db, $element_id, $tableElements, $tableAttributes, $tableChilds )
Read a single XML node from the db- Object &$db: A db pointer (AdoDb library)
- integer $element_id: The db's id of the node
- string $tableElements: The table that contains the elements
- string $tableAttributes: The table that contains the attributes
- string $tableChilds: The table that contains the childs
private
void readFromDb ( &$db, $tableElements, [$rootTag = ''], [$tableAttributes = ''], [$tableChilds = ''] )
Read a whole XML tree (an XML document) from the db- Object &$db: A db pointer (AdoDb library)
- string $tableElements: The table that contains the elements
- string $rootTag: The tag that represents the root of the document
- string $tableAttributes: The table that contains the attributes
- string $tableChilds: The table that contains the childs
public
void readFromFile ( $fileName )
Read a whole XML tree (a XML document) from a file- string $fileName: The name of file
public
void readFromString ( $str )
Read a whole XML tree (a XML document) from a string- string $fstr: The string
public
void saveAttributesToDb ( $db, $owner_id, &$attributes, $tableAttributes )
Save the attributes of a single XML node to the db- Object &$db: A db pointer (AdoDb library)
- integer $owner_id: The db's id of the XML node
- array &$attributes: The attributes to save
- string $tableAttributes: The table that contains the attributes
private
void saveChildsToDb ( $db, $tableElements, $element_id, $element, $tableAttributes, $tableChilds )
Save the childs of a single XML node to the db- Object &$db: A db pointer (AdoDb library)
- string $tableElements: The table that contains the elements
- STPHPXmlElement $element_id: The XML node
- string $tableAttributes: The table that contains the attributes
- string $tableChilds: The table that contains the childs
private
void saveElementToDb ( $db, $tableElements, $tableAttributes, $tableChilds, [$root = '0'], $element )
Save a single XML node to the db- Object &$db: A db pointer (AdoDb library)
- integer $element_id: The db's id of the node
- string $tableElements: The table that contains the elements
- string $tableAttributes: The table that contains the attributes
- string $tableChilds: The table that contains the childs
- string $root: The root tag
- STPHPXmlElement $element: The element to save
private
void saveElementToFile ( &$fp, &$element, $level )
Save a single XML node to a file- integer $fp: The file pointer
- STPHPXmlElement &$element: The element to save
- integer $level: The element's level
private
void saveToDb ( &$db, $tableElements, [$tableAttributes = ''], [$tableChilds = ''] )
Save the whole XML tree (an XML document) to the db- Object &$db: A db pointer (AdoDb library)
- string $tableElements: The table that contains the elements
- string $rootTag: The tag that represents the root of the document
- string $tableAttributes: The table that contains the attributes
- string $tableChilds: The table that contains the childs
public
void saveToFile ( $fileName )
Save the whole XML tree (an XML document) to a file- string $fileName: The name of file
public
void tag_close ( $parser, $tag )
The handler for parsing the tag closing for XML- string $parser: An istance of the parser
- string $tag: The read tag
private
void tag_open ( $parser, $tag, $attributes )
The handler for parsing the tag opening for XML- string $parser: An istance of the parser
- string $tag: The read tag
- array $attributes: The tag's attributes
private