December 2001
Intermediate to advanced
520 pages
13h 42m
English
One final alteration you'll probably want to make to the parse.php script is to take into account error handling. Because part of the purpose of parsing XML files is to check that they are well-formed (free of errors), you'll want to devise a system for making note of any issues. There are two primary XML error-handling functions to use.
xml_get_error_code($parser); xml_error_string($error_code);
The first function takes the $parser reference as its argument and will report the error code associated with the parser, when an error occurs. The second function can take this code and turn it into a string version of the problem.
Almost every resource I've seen discussing PHP and Expat uses some variation on the following for ...
Read now
Unlock full access