You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Alberto Massari <am...@datadirect.com> on 2005/04/11 17:45:04 UTC

Re: What is the mechanism involved in parsing an InputSource object using Xerces C++ SAX?

Hi Girish,
if you don't have the entire XML stream available when parsing starts, you 
need to define a InputSource-derived object that creates a 
BinInputStream-derived object that, inside the readBytes callback, will 
fill the provided buffer with a new chunk of data.

Alberto

At 18.30 11/04/2005 +0530, Girish Chandran wrote:
>Hi All,
>
>     I need to understand how parsing of a file or a stream(XML data in
>memory) takes place in Xerces C++. I am using SAX XMLReader and passing xml
>input as a file path or a MemBufInputSource object. In order to create a
>MemBufInputSource object I need to have the entire data in memory(as given
>in MemParse sample). This may create problems if I have a large amount of
>data, say in hundreds of MB.
>
>In case of files, does the parser read the entire file into memory and then
>parse it? or Does it read it in chunks?
>If  it does it in chunks can we simulate the same for xml data in  memory?
>What are the things to be taken care of in this case?
>
>The need to understand the mechanism arises from the requirement to
>progressively parse xml data by loading small chunks into the memory.
>Can somebody give me some pointers in this regard?
>
>Thanking you in advance!
>
>warm regards,
>Girish
>
>-------------------------------------
>Girish Chandran
>
>Mail  : girish_chandran@persistent.co.in
>PH. (O)       : 020-25678900 extn. 2364
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: What is the mechanism involved in parsing an InputSource object using Xerces C++ SAX?

Posted by Atul Bansal <at...@gmail.com>.

Alberto Massari <amassari <at> datadirect.com> writes:

> 
> Hi Girish,
> if you don't have the entire XML stream available when parsing starts, you 
> need to define a InputSource-derived object that creates a 
> BinInputStream-derived object that, inside the readBytes callback, will 
> fill the provided buffer with a new chunk of data.
> 
> Alberto
> 


Hi Alberto,

Can you please share a c++ example of this idea ?

Thanks
Atul




---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org