Re: Get XML content using XML::Twig



On 21 avr, 14:35, alwaysonnet <kalyanrajsi...@xxxxxxxxx> wrote:
Hello all,
I'm trying to parse the XML using XML::Twig Module as my XML could be
very large to handle using XML::Simple.

On Wed, 21 Apr 2010 10:06:14, Klaus <klau...@xxxxxxxxx> wrote:
What Tad McClellan and John Bokma suggested should be your first
path of investigation.
However, let me bring in a shameless plug:
You could also use my module XML::Reader
http://search.cpan.org/~keichner/XML-Reader-0.32/lib/XML/Reader.pm

On 21 avr, 20:07, s...@xxxxxxxxxxxxxxx wrote:
Indeed shameless.

On 22 avr, 10:24, alwaysonnet <kalyanrajsi...@xxxxxxxxx> wrote:
My intention is to ~
- Get each sender and receiver
- Get the filetype ( could be InitTAP, FatalRAP etc )
- For each of filetype get the TAPSeqNo, NoofCalls etc....

Basically I want all the information in place for processing the
data....

Also, apart from XML::Twig, is there any module which can handle
larger XML files..

As I said before, take the advice of Tad McClellan and John Bokma
first.

If, for whatever reason, you can't follow their advice, (and, for
whatever reason, you can't use XML::Twig either) there is always my
"shameless plug" XML::Reader:

There are, in my opinion, two scenarios:

Scenario 1:
You already know how to parse your XML with XML::Simple, but the XML
file is too big to fit entirely into memory.
In that case, I suggest you follow my example (with XML::Reader) that
I gave in this thread today (where I said: "...Here is an example of
how to use XML::Reader to capture sub-trees...)
see http://groups.google.com/group/comp.lang.perl.misc/msg/4bb3a769d96c1b2e

Scenario 2:
You know the general rules of your XML parsing, but you don't know
which XML module to use (and you can't follow the advice from Tad
McClellan and from John Bokma).
In that case I suggest you follow my example (with XML::Reader) that I
gave in this thread yesterday (where I said: "...use XML::Reader-
newhd(... {filter => 2})...")
see http://groups.google.com/group/comp.lang.perl.misc/msg/762534f342f939e6
.