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

Class: xmlDoc

Source Location: /safox_g.cls.php

Class xmlDoc

Class Overview

class xmlDoc

Changes History : See File Information for changes *

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



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

Properties

Methods

[ Top ]
Property Summary
mixed   $EntityConversion   Constructor

[ Top ]
Method Summary
xmlDoc   xmlDoc()  
xmlnode   &addNode()   addNode Adds a Node to the Main part of the xmlDoc;
xmlnode   &addNodeAfter()   Adds a new Node to the Document directly *after* a specified node, whereas addNode() method adds a node to the end of the Document
xmlnode   &addNodeBefore()   Adds a new Node to the Document directly *before* a specified node, whereas addNode() method adds a node to the end of the Document
void   cleanUp()   Cleans up internal data arrays from removed nodes and rebuilts the ID Referencing Array
void   destroy()   Destructor- empties internal data
mixed   &getChildNodeByTagName()   getChildNodeByTagName - direct reference to xmlNode Object if only one tag found, array of xmlNode Object references if more found, or boolean false -- suggested by Cristiano
SAFOXDOC   getId()   return Id (Constant SAFOXDOC) This function returns the mixed returns the UIDA (Unique ID Attribute) Value of current node, for the XMLDOC returns SAFOXDOC (constant)
mixed   &getNextNode()   Returns next Reference to Child Node or False;
mixed   &getNodeById()   Return a xmlNodeObject or False
void   setEncoding()   Set the XML-Document Encoding Attribute
void   setEntityConversion()   setEntityConversion is a function that specifies whether or not special characters in CDATA should be converted into HT/XML-Entities (e.g.
void   setStandAlone()   Sets the XML Document StandAlone Attribute
void   setUida()   Set the "Unique ID Attribute"-name (usually ID)
void   setVersion()   Sets the XML-Document Version-Attribute
boolean   writeToFile()   Writing an XML Document to File
string   writeXML()   returns a string of the XML Document

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

Constructor


[ Top ]
Methods
Constructor xmlDoc  [line 140]

  xmlDoc xmlDoc( )



[ Top ]
addNode  [line 222]

  xmlnode &addNode( [$nodeType $nodeType = "DATA"], [$id $id = false]  )

addNode Adds a Node to the Main part of the xmlDoc;

Parameters:
$nodeType   $nodeType:  typ 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


[ Top ]
addNodeAfter  [line 248]

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

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

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 301]

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

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

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 190]

  void cleanUp( )

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

This method should be called directly after removing nodes from the document, 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 ]
destroy  [line 160]

  void destroy( [clean $clean = false]  )

Destructor- empties internal data

Parameters:
clean   $clean: 
  • boolean if set true all nodes will be destroyed recursively


[ Top ]
getChildNodeByTagName  [line 456]

  mixed &getChildNodeByTagName( string $tagName  )

getChildNodeByTagName - direct reference to xmlNode Object if only one tag found, array of xmlNode Object references if more found, or boolean false -- suggested by Cristiano

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

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


[ Top ]
getId  [line 410]

  SAFOXDOC getId( )

return Id (Constant SAFOXDOC) This function returns the mixed returns the UIDA (Unique ID Attribute) Value of current node, for the XMLDOC returns SAFOXDOC (constant)



[ Top ]
getNextNode  [line 429]

  mixed &getNextNode( [$step $step = 1]  )

Returns next Reference to Child Node or False;

Parameters:
$step   $step:  -- Int Step & Direction : -1 previous;0-current; 1-next; 2-next after next etc.

API Tags:
Return:  unknown or boolean -- return false if End or Beginning reached


[ Top ]
getNodeById  [line 416]

  mixed &getNodeById( $id $id  )

Return a xmlNodeObject or False

Parameters:
$id   $id: 
  • mixed registered ID value (UIDA)

API Tags:
Return:  reference to xmlnode or boolean false if not found


[ Top ]
setEncoding  [line 354]

  void setEncoding( [$encoding $encoding = "utf-8"]  )

Set the XML-Document Encoding Attribute

Parameters:
$encoding   $encoding: 
  • string by default "utf-8"


[ Top ]
setEntityConversion  [line 152]

  void 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


[ Top ]
setStandAlone  [line 370]

  void setStandAlone( [$standalone $standalone = true]  )

Sets the XML Document StandAlone Attribute

Parameters:
$standalone   $standalone: 
  • boolean sets the standalone attribute of xml document


[ Top ]
setUida  [line 177]

  void setUida( [$uida $uida = "id"]  )

Set the "Unique ID Attribute"-name (usually ID)

Parameters:
$uida   $uida: 
  • the name of the unique ID attribute


[ Top ]
setVersion  [line 362]

  void setVersion( [$version $version = "1.0"]  )

Sets the XML-Document Version-Attribute

Parameters:
$version   $version: 
  • string by default "1.0"


[ Top ]
writeToFile  [line 520]

  boolean writeToFile( $filepath $filepath  )

Writing an XML Document to File

Parameters:
$filepath   $filepath: 
  • specified filepath

API Tags:
Return:  success / failure


[ Top ]
writeXML  [line 477]

  string writeXML( )

returns a string of the XML Document


API Tags:
Return:  of xmlDocument


[ Top ]

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