Re: XML HELP
| From: | Michael Virnstein | Date: | Wed, 10 Apr 2002 09:02:03 +0000 |
| Subject: | Re: XML HELP | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92354@lists.php.net to get a copy of this message | ||
Why don't you use this class...it's really good!
http://sourceforge.net/projects/phpxpath/
"Analysis & Solutions" <danielc@analysisandsolutions.com> schrieb im
Newsbeitrag news:20020409023328.GA3141@panix.com...
> Hey Christopher:
>
> On Mon, Apr 08, 2002 at 09:14:08PM -0400, Christopher J. Crane wrote:
> > ok I tried this at your suggestion....
>
> Not exactly. As mentioned, you've got all sorts of unneded stuff going
> on. To make sure you're on the right track, start with a new script
> with just the basics:
>
>
> <?php
>
> $Symbols[] = 'ek';
> $Symbols[] = 'et';
>
> $URI =
> 'http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=';
>
>
> function StartHandler($Parser, $ElementName, $Attr='') {
> }
>
> function CharacterHandler($Parser, $Line) {
> }
>
> function EndHandler($Parser, $ElementName, $Attr='') {
> }
>
>
> while ( list(,$Sym) = each($Symbols) ) {
> $Contents = implode( '', file("$URI$Sym") );
>
> $Parser = xml_parser_create('ISO-8859-1');
> xml_set_element_handler($Parser, 'StartHandler', 'EndHandler');
> xml_set_character_data_handler($Parser, 'CharacterHandler');
>
> if ( xml_parse($Parser, $Contents) ) {
> echo 'YES!';
> } else {
> echo 'NO!';
> }
>
> xml_parser_free($Parser);
>
> }
>
> ?>
>
>
> Now, if that works, start flushing out the element/character handlers.
> Do it little by little to make sure each of your steps are correct.
>
> Enjoy,
>
> --Dan
>
> --
> PHP classes that make web design easier
> SQL Solution | Layout Solution | Form Solution
> sqlsolution.info | layoutsolution.info | formsolution.info
> T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
> 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409