harsha.reddy has asked for the wisdom of the Perl Monks concerning the following question:
I have a small perl testing application which glups XML data. All these days I was using XML::Mini Parser, since the XML::Mini has DOM kind of API.
Now I have decided to use SAX based parser (XML::Parser::PerlSAX).
I see in SAX approach the data is collected via call back functions.
This call back thing has made me to re-design stuff, that is call all the rest of the logic from
these call back functions, which I don;t want to do.
Instead, I want to read the XML bit by bit and parse it. So I decided to open() the file and read() it.
From the XML::Parser::PerlSAX documentation I found that this module has a method named:
XML::Parser::PerlSAX->location() which returns:
BytePosition The current byte position of the parse.
I am very much intrested in this attribute "BytePosition", I can say, my rest of the logic is depended on this "BytePosition".
But unfortunately I din;t find direct method to consume this XML::Parser::PerlSAX->location() function.
The questions I have is:
1. Are there any internel hooks that can return the "BytePosition - The current byte position of the parse."
2. How to lazy evaluate call-back routines of XML::Parser::PerlSAX to fetch limited data on request?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML-Parser-PerlSAX how to get the BytePosition value
by Anonymous Monk on Apr 01, 2008 at 07:24 UTC | |
by Anonymous Monk on Apr 01, 2008 at 14:23 UTC | |
by quaker (Initiate) on May 13, 2008 at 22:26 UTC |