Login   Register  
PHP Classes
elePHPant
Icontem

File: path_parser.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Luis Argerich  >  Path Parser  >  path_parser.php  >  Download  
File: path_parser.php
Role: ???
Content type: text/plain
Description: An example script using the class
Class: Path Parser
Generic SAX parsing for XML made easy
Author: By
Last change:
Date: 12 years ago
Size: 453 bytes
 

Contents

Class file image Download
<?
include_once("class_path_parser.php");

function name($name,$attribs,$content) {
  print("<br/>");
  print("Hey $name <br/>\n");
  print_r($attribs);
  print("<br/>");
}

$parser = new Path_parser();
$parser->set_handler("/foo/data/name","name");
$parser->set_handler("/foo/data","name");
$parser->set_handler("/foo/data/type/var","name");
if(!$parser->parse_file("foo.xml")) {
  print("Error:".$parser->get_error()."<br/>\n"); 
}
?>