parse() public method

Central parsing function.
public parse ( ) : boolean | PEAR_Error
return boolean | PEAR_Error returns true on success, or a PEAR_Error otherwise
Ejemplo n.º 1
0
 /**
  *  This function parses the XML data and retrieves the version and encoding.
  *
  *  @param $data   The XML data.
  */
 function parseXML($data)
 {
     // Strip white space
     $data = preg_replace("/>\\s+</i", "><", $data);
     $parser = new XML_Parser($this);
     $parser->encoding = YDConfig::get('YD_XML_ENCODING', 'UTF-8');
     $parser->parse($data);
     // Get version and encoding
     if (!is_null($parser->version)) {
         $this->version = $parser->version;
     }
     if (!is_null($parser->encoding)) {
         $this->encoding = $parser->encoding;
     }
 }
 /**
  * Parses the XML text specified in the data argument.
  *
  * @param string $data the XML document to parse.
  */
 function parseXML($data)
 {
     // Strip white space
     $data = preg_replace("/>\\s+</i", "><", $data);
     $parser = new XML_Parser($this);
     $parser->parse($data);
 }