Thanks John. But how would I move to the interested offset when I already have the offset. I'm not aware of any lseek like call in Xerces.
Manish -----Original Message----- From: John Lilley [mailto:[email protected]] Sent: Thursday, October 08, 2009 7:04 PM To: [email protected] Subject: RE: Reading portions of XML file. Er, a bit cleaner snippet: You can subclass InputSource and InputStream, then implement it however you like. In this snippet, XN:: is defined as the Xerces namespace. class MyFileInputStream : public XN::BinInputStream { public: MyFileInputStream(...) {} virtual XMLFilePos curPos() const { return ... } virtual XMLSize_t readBytes(XMLByte* const toFill, const XMLSize_t maxToRead) { return ...; } // No "out-of-band" content type virtual const XMLCh* getContentType() const { return 0; } private: ... }; class MyFileInputSource : public XN::InputSource { public : MyFileInputSource(...) {} virtual XN::BinInputStream* makeStream() const { // Caller is owner of stream return new MyFileInputStream(...); } private: ... }; john -----Original Message----- From: Galande, Manish [mailto:[email protected]] Sent: Thursday, October 08, 2009 7:12 AM To: [email protected] Subject: Reading portions of XML file. Hi, I want to read the portions of XML file depending on byte-position, using getSrcOffset(). Is there a way I can directly start reading/parsing from a pre-defined offset in the source, similar to lseek and read? Thanks. Manish
