CORE POS - IS4C
The CORE POS front end
Public Member Functions | Public Attributes | List of all members
xmlData Class Reference

Public Member Functions

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

Public Attributes

 $parser
 
 $DATA
 
 $curTag
 
 $valid
 

Detailed Description

A very generic parser class for XML data

Member Function Documentation

xmlData::array_dump ( )

Export XML content to an array

Returns
an array

Debugging method

xmlData::endTag (   $parser,
  $name 
)

xml_parser callback for a closing tag

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
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().

xmlData::isValid ( )

Check if at least some xml parsed successfully.

Returns
True or False
xmlData::startTag (   $parser,
  $name,
  $attr 
)

xml_parser callback for an opening tag

xmlData::tagData (   $parser,
  $data 
)

xml_parser callback for data between tags

xmlData::xmlData (   $str)

Constructor Create parser from XML

Parameters
$stran XML string

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