PACKAGE PROPOSAL: XML_XMLPull

From: Date: Fri, 12 Sep 2003 23:07:51 +0000
Subject: PACKAGE PROPOSAL: XML_XMLPull
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-21453@lists.php.net to get a copy of this message
Would like to propose PEAR::XML_XMLPull, which is a pull based API for parsing XML, that (arguably) makes it alot easier to parse XML. I've prepared a PEAR package (0.1.0rc1) here: http://sourceforge.net/project/showfiles.php?group_id=87488&release_id=184205 - you need to have PEAR::XML_SaxFilters 0.2.0 installed first to run the example. Essentially what XMLPull does is eliminate the need for handler functions (as with the SAX API) and rather deal with something like a switch statement, e.g.; while ( $event = $parser->parse() ) { switch ( $type = $event->getType() ) {
       case XML_PULL_START_TAG:
// Start tag handled here
       break;
       case XML_PULL_END_TAG:
// End tag handled here
       break;
       case XML_PULL_TEXT:
// Character data handled here
       break;
} } There's more info on XML Pull at http://www.xmlpull.org (the API I've defined only loosely conforms to the Java API described there).

« previous php.pear.dev (#21453) next »