CORE POS - IS4C
The CORE POS front end
Public Member Functions | Public Attributes | List of all members
COREPOS\pos\plugins\Paycards\xml\XmlData Class Reference

Public Member Functions

 __construct ($str)
 
 startTag ($parser, $name, $attr)
 
 endTag ($parser, $name)
 
 tagData ($parser, $data)
 
 get ($tagname)
 
 isValid ()
 
 get_first ($tagname)
 
 arrayDump ()
 

Public Attributes

 $parser
 
 $DATA
 
 $curTag
 
 $valid
 

Detailed Description

A very generic parser class for XML data

Constructor & Destructor Documentation

COREPOS\pos\plugins\Paycards\xml\XmlData::__construct (   $str)

Constructor Create parser from XML

Parameters
$stran XML string

Member Function Documentation

COREPOS\pos\plugins\Paycards\xml\XmlData::arrayDump ( )

Export XML content to an array

Returns
an array

Debugging method

COREPOS\pos\plugins\Paycards\xml\XmlData::endTag (   $parser,
  $name 
)

xml_parser callback for a closing tag

COREPOS\pos\plugins\Paycards\xml\XmlData::get (   $tagname)

Get a value by tag name

Parameters
$tagnamethe tag name
Returns
  • string value if one tag has the given name
  • an array if multiple tags have the given name
  • False if no such tag
COREPOS\pos\plugins\Paycards\xml\XmlData::get_first (   $tagname)

Get a value by tag name

Parameters
$tagnamethe tag name
Returns
  • String value if the tag exists
  • False if the tag doesn't exist

This method works a tad more reliably than get().

COREPOS\pos\plugins\Paycards\xml\XmlData::isValid ( )

Check if at least some xml parsed successfully.

Returns
True or False
COREPOS\pos\plugins\Paycards\xml\XmlData::startTag (   $parser,
  $name,
  $attr 
)

xml_parser callback for an opening tag

COREPOS\pos\plugins\Paycards\xml\XmlData::tagData (   $parser,
  $data 
)

xml_parser callback for data between tags


The documentation for this class was generated from the following file: