Consider implementing your own FormatTarget.  LocalFileFormatTarget is
very simple.  Just clone it except for the constructors.  You'll want
your own contructor that takes a FILE *, or perhaps a FileHandle.  If a
Xerces FileHandle is a FILE * on your platform, all the constructor
needs to do is assign the constructor's FILE * parameter to fSource.  If
not, you'll have to convert your FILE * to a FileHandle in the
constructor (assuming it's possible), or pass a FileHandle to the
constructor instead of a FILE *.

You'll note that LocalFileFormatTarget closes the file handle in its
destructor.  You may or may not want that behavior in your own class.
Since you're passing in an open file, you are presumably prepared to
close it.

> -----Original Message-----
> From: Imran A R (RBIN/EDM1) * [mailto:[EMAIL PROTECTED] 
> Sent: Friday, May 28, 2004 5:29 AM
> To: [EMAIL PROTECTED]
> Subject: passing FILE*
> 
> 
> 
> 
> Hi All
> 
>       Am trying to  serialize a DOM doc into a physical file.
> 
>             this is the code,
> 
>       XMLFormatTarget *myFormTarget = new 
> LocalFileFormatTarget(filename );             
>                       
>       //Write out the specified node as described above in 
> the description of DOMWriter. 
>       theSerializer->writeNode(myFormTarget, *m_pDOMDocument);
> 
>       in LocalFileFormatTarget, i have to give filename , right
> 
>       is there anyway If I have FILE* with me 
> 
> THanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to