Re: PACKAGE PROPOSAL: XML_XMLPull (OOPS)

From: Date: Fri, 12 Sep 2003 23:34:15 +0000
Subject: Re: PACKAGE PROPOSAL: XML_XMLPull (OOPS)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-21456@lists.php.net to get a copy of this message
(Must not forget diff, must not forget diff, must not forget diff) $ diff -u XML_XMLPull-0.1.0rc1 XML_XMLPull-0.1.0rc1-fixed Common subdirectories: XML_XMLPull-0.1.0rc1/XMLPull and XML_XMLPull-0.1.0rc1-fixed/XMLPull diff -u XML_XMLPull-0.1.0rc1/XML_XMLPull.php XML_XMLPull-0.1.0rc1-fixed/XML_XMLPull.php --- XML_XMLPull-0.1.0rc1/XML_XMLPull.php 2003-09-12 13:58:24.000000000 -0700 +++ XML_XMLPull-0.1.0rc1-fixed/XML_XMLPull.php 2003-09-12 16:26:11.000000000 -0700 @@ -32,8 +32,8 @@ if (!defined('XML_SAXFILTERS')) { define('XML_SAXFILTERS', 'XML/'); } -require_once(XML_XMLPULL.'XmlPull/PushListener.php'); -require_once(XML_XMLPULL.'XmlPull/PullParser.php'); +require_once(XML_XMLPULL.'XMLPull/PushListener.php'); +require_once(XML_XMLPULL.'XMLPull/PullParser.php'); /** * Factory function for creating the pull parser * @param string parser type ('Expat' or 'HTMLSax') @@ -64,11 +64,11 @@ } switch ( strtolower($parserType) ) { case 'expat': - require_once(XML_XMLPULL.'XmlPull/ExpatPushListener.php'); + require_once(XML_XMLPULL.'XMLPull/ExpatPushListener.php'); $push = & new XML_XMLPull_Expat($reader); break; case 'htmlsax': - require_once(XML_XMLPULL.'XmlPull/HTMLSaxPushListener.php'); + require_once(XML_XMLPULL.'XMLPull/HTMLSaxPushListener.php'); $push = & new XML_XMLPull_HTMLSax($reader); break; default: @@ -77,4 +77,4 @@ } return new XML_XMLPull_PullParser($push); } -?> \ No newline at end of file +?> --- "Jesus M. Castagnetto" <jcastagnetto@yahoo.com> wrote: > Code looks good, and the idea of having an XML Pull parser is great > (something > I was missing in PEAR/PHP). > > Just some problems w/ the code: > > - You refer to 'XmlPull' in several require_once() statements, but the name > of > the dir is 'XMLPull'. I am including the diff below. > > - You refer to 'HTMLSaxPushListener.php', but the file is > 'HtmlSaxPushListener.php', a rename of the file should fix that. > > Overall, with the simple fixes mentioned, I would like to see this package in > PEAR. I'll look forward for when you call for a vote (right now we are in the > proposal phase of the process). > > Had looked at the code, but not in great detail, as first I need to > understand > exactly how the pull parsing works. > > Great job Harry. > > --- Harry Fuecks <hfuecks@phppatterns.com> wrote: > > 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). > > > > -- > > PEAR Development Mailing List (http://pear.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > ===== > -- > Jesus M. Castagnetto (jcastagnetto@yahoo.com) > Research: http://metallo.scripps.edu/ > Personal: http://www.castagnetto.org/ > PEAR stuff: http://pear.php.net/user/jmcastagnetto > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > ===== -- Jesus M. Castagnetto (jcastagnetto@yahoo.com) Research: http://metallo.scripps.edu/ Personal: http://www.castagnetto.org/ PEAR stuff: http://pear.php.net/user/jmcastagnetto __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com

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