http://qs321.pair.com?node_id=949099


in reply to Issue with looping through XML::LibXML::Reader

The problem seems to be that you are reading the next Instrmt element in a while loop and as a result you skip the parent MktDataFull elements.

If you change the while() to an if() it should fix the main issue.

... if ( $reader->nextElement( 'Instrmt' ) ) { my $Sym = $reader->getAttribute( 'Sym' ); ...

--
John.

Replies are listed 'Best First'.
Re^2: Issue with looping through XML::LibXML::Reader
by ozguy (Novice) on Jan 22, 2012 at 06:22 UTC

    As easy as that..... Thank you so much for the quick and helpful response John.

    I did have also comment out one of the last read requests ($reader->nextSibling() > 0 or last;) as well, and it now works as it should.