Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Issue with looping through XML::LibXML::Reader

by jmcnamara (Monsignor)
on Jan 21, 2012 at 02:34 UTC ( #949099=note: print w/replies, xml ) Need Help??

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' ); ...


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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://949099]
[erix]: the annoying thing is that during setup of the 'foreign table' you have to specify all the columns. But that is reasonably automatable (just reading header line, and contruct the needed CREATE FOREIGN TABLE' statement)
[erix]: it may be easier to just slurp your fils into regular tables. Has other infrastructure advantages also (indexes, constraints etc)

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2018-02-23 15:31 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (302 votes). Check out past polls.