phpDocumentor SpoolTemplate
[ Back ] [ class tree: SpoolTemplate ] [ index: SpoolTemplate ] [ all elements ]

Class: CXml2Array

Source Location: /CXml2Array.php

Class CXml2Array

Property Summary
mixed   $AttribFirstTime  
string   $Extension   Which PHP extension the module uses to parse the XML data
mixed   $IntTmpTag  
mixed   $TagFirstTime  
array   $TheArray   Array containg the file XML
mixed   $tmpAttrib   Temporary arrays
mixed   $tmpTag  

[ Top ]
Method Summary
CXml2Array   CXml2Array()   Class initializer
void   ArrayDump()   Dump the array contents in human format.
array   EachAttribute()   The function iterate over attribute's array of the root element
object CXml2Array   EachChild()   The function iterate over tag's array of the root element
array   EachChildArray()   The function iterate over tag's array of the root element
bool   ExistAttribute()   Does exist the request attribute? The function looks only if the attribute exists as child of the root element.
bool   ExistTag()   Does exist the request tag? The function looks only if the tag exists as child of the root element.
void   GetArray()   Return the XML as array
string   GetAttribute()   Return value of the named attribute
string   GetNodeName()   Return the name of the root tag
array   GetTag()   The function return all childs of the root element named $TagName
array   GetTagAttributes()   The function return all attributes of $TagName. Note $TagName should be a child of the
array   GetTagChilds()   The function return all childs of $TagName. Note $TagName should be a child of the
array   GetTagPos()   The function return all childs of the root element named $TagName
string   GetText()   Return value of the root tag
void   LoadFromArray()   Load the array from another array retrieved from this class.
bool   LoadFromFile()   Load data from filename
bool   LoadFromString()   Load data from xml string
object CXml2Array   _ChildLoop()   The function iterate over tag's array of the root element
boolean   __php5()   Return True if the current PHP version is 5

[ Top ]
Properties
mixed   $AttribFirstTime [line 45]

[ Top ]
string   $Extension [line 53]

Which PHP extension the module uses to parse the XML data

API Tags:
See:  _WhichExtension()


[ Top ]
mixed   $IntTmpTag [line 47]

[ Top ]
mixed   $TagFirstTime [line 46]

[ Top ]
array   $TheArray [line 37]

Array containg the file XML

structure: ['text'] -> text inside the tag ['attrib'][attribname] -> tag's attribute ['child'][] -> child tag information. It holds many child with the same name


[ Top ]
mixed   $tmpAttrib [line 42]

Temporary arrays


[ Top ]
mixed   $tmpTag [line 43]

[ Top ]
Methods
Constructor CXml2Array  [line 60]

  CXml2Array CXml2Array( [mixed $node = '']  )

Class initializer

Parameters:
mixed   $node:  object DOM XML or array returned by GetTag

API Tags:
See:  CXml2Array::GetTag()
Access:  public


[ Top ]
ArrayDump  [line 348]

  void ArrayDump( )

Dump the array contents in human format.

Usefull for debug purpose


API Tags:
Access:  public


[ Top ]
EachAttribute  [line 569]

  array EachAttribute( [bool $reset = FALSE]  )

The function iterate over attribute's array of the root element

Parameters:
bool   $reset:  Set to TRUE to reset the internal pointer

API Tags:
Access:  public


[ Top ]
EachChild  [line 603]

  object CXml2Array EachChild( [bool $reset = FALSE]  )

The function iterate over tag's array of the root element

Public method

Parameters:
bool   $reset:  Set to TRUE to reset the internal pointer

API Tags:
See:  CXml2Array::_ChildLoop()
Access:  public


[ Top ]
EachChildArray  [line 616]

  array EachChildArray( [bool $reset = FALSE]  )

The function iterate over tag's array of the root element

Public method

Parameters:
bool   $reset:  Set to TRUE to reset the internal pointer

API Tags:
See:  CXml2Array::_ChildLoop()
Access:  public


[ Top ]
ExistAttribute  [line 416]

  bool ExistAttribute( string $AttribName  )

Does exist the request attribute? The function looks only if the attribute exists as child of the root element.

Parameters:
string   $AttribName: 

API Tags:
Access:  public


[ Top ]
ExistTag  [line 397]

  bool ExistTag( string $TagName  )

Does exist the request tag? The function looks only if the tag exists as child of the root element.

Parameters:
string   $TagName: 

API Tags:
Access:  public


[ Top ]
GetArray  [line 425]

  void GetArray( )

Return the XML as array


API Tags:
Access:  public


[ Top ]
GetAttribute  [line 534]

  string GetAttribute( string $AttribName  )

Return value of the named attribute

Parameters:
string   $AttribName: 

API Tags:
Access:  public


[ Top ]
GetNodeName  [line 557]

  string GetNodeName( )

Return the name of the root tag


API Tags:
Access:  public


[ Top ]
GetTag  [line 436]

  array GetTag( string $TagName  )

The function return all childs of the root element named $TagName

Parameters:
string   $TagName: 

API Tags:
Access:  public


[ Top ]
GetTagAttributes  [line 512]

  array GetTagAttributes( string $TagName, [integer $Position = 0]  )

The function return all attributes of $TagName. Note $TagName should be a child of the

root element

Parameters:
string   $TagName: 
integer   $Position:  Select from which child retrieve the information, if more child of root element have the same name

API Tags:
Access:  public


[ Top ]
GetTagChilds  [line 487]

  array GetTagChilds( string $TagName, [integer $Position = 0]  )

The function return all childs of $TagName. Note $TagName should be a child of the

root element

Parameters:
string   $TagName: 
integer   $Position:  Select from which child retrieve the information, if more child of root element have the same name

API Tags:
Access:  public


[ Top ]
GetTagPos  [line 462]

  array GetTagPos( string $TagName, [mixed $Position = 0]  )

The function return all childs of the root element named $TagName

Parameters:
string   $TagName: 

API Tags:
Access:  public


[ Top ]
GetText  [line 547]

  string GetText( )

Return value of the root tag


API Tags:
Access:  public


[ Top ]
LoadFromArray  [line 334]

  void LoadFromArray( array $data  )

Load the array from another array retrieved from this class.

It is usefull to apply the module's function to the deepest part of the original array

Parameters:
array   $data: 


[ Top ]
LoadFromFile  [line 88]

  bool LoadFromFile( string $FileName  )

Load data from filename

Parameters:
string   $FileName:  filename

API Tags:
Return:  true if the file is successfully parsed
Access:  public


[ Top ]
LoadFromString  [line 116]

  bool LoadFromString( string $XmlStr  )

Load data from xml string

Parameters:
string   $XmlStr:  XML text

API Tags:
Return:  true if the file is successfully parsed
Access:  public


[ Top ]
_ChildLoop  [line 631]

  object CXml2Array _ChildLoop( bool $reset, bool $ReturnObj  )

The function iterate over tag's array of the root element

Parameters:
bool   $reset:  Set to TRUE to reset the internal pointer (return TRUE)
bool   $ReturnObj:  Set to TRUE to return an object CXml2Array, o FALSE to return tha child's value as array

API Tags:
See:  _EachChildArray()
See:  _EachChild()
Access:  public


[ Top ]
__php5  [line 155]

  boolean __php5( )

Return True if the current PHP version is 5

False if is PHP4


API Tags:
Access:  public


[ Top ]

Documentation generated on Mon, 28 Mar 2005 15:13:08 +0200 by phpDocumentor 1.3.0RC3