Connecting Tech Pros Worldwide Forums | Help | Site Map

XMLWriter and XMLDocument

David Withnall
Guest
 
Posts: n/a
#1: Nov 12 '05
Okay

I am using an XMLDocument object to process several thousands of lodgements (from a database)

I am trying to output it from an XML Document to a file using the XmlDocument.WriteTo() method with an XmlWriter. It writes 131kB and then cuts out halfway through an element

Is this a limitation of XmlDocument.WriteTo() ? What would be a better way to output it

Thanks

Daniel Cazzulino [MVP XML]
Guest
 
Posts: n/a
#2: Nov 12 '05

re: XMLWriter and XMLDocument


Ensure you're calling XmlWriter.Close() to cause the buffered writes to be
flushed to the underlying stream/textwriter.

--
Daniel Cazzulino [MVP XML]
Clarius Consulting SA
http://weblogs.asp.net/cazzu
http://aspnet2.com

"David Withnall" <anonymous@discussions.microsoft.com> wrote in message
news:041B3C13-C1AD-4599-BD11-EE1A19895821@microsoft.com...[color=blue]
> Okay,
>
> I am using an XMLDocument object to process several thousands of[/color]
lodgements (from a database).[color=blue]
>
> I am trying to output it from an XML Document to a file using the[/color]
XmlDocument.WriteTo() method with an XmlWriter. It writes 131kB and then
cuts out halfway through an element.[color=blue]
>
> Is this a limitation of XmlDocument.WriteTo() ? What would be a better way[/color]
to output it?[color=blue]
>
> Thanks[/color]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.679 / Virus Database: 441 - Release Date: 09/05/2004


Sonu Kapoor
Guest
 
Posts: n/a
#3: Nov 12 '05

re: XMLWriter and XMLDocument


From msdn:

XmlWriter.Flush Method:
This is called instead of Close when you want to write
more to the underlying stream without losing what is still
in the buffer.

Sonu
My Blog: http://weblogs.asp.net/sonukapoor/

[color=blue]
>-----Original Message-----
>Okay,
>
>I am using an XMLDocument object to process several[/color]
thousands of lodgements (from a database).[color=blue]
>
>I am trying to output it from an XML Document to a file[/color]
using the XmlDocument.WriteTo() method with an XmlWriter.
It writes 131kB and then cuts out halfway through an
element.[color=blue]
>
>Is this a limitation of XmlDocument.WriteTo() ? What[/color]
would be a better way to output it?[color=blue]
>
>Thanks
>.
>[/color]
Closed Thread