XmlTextWriter and whitespace

  • Thread starter Thread starter st
  • Start date Start date
S

st

Hi,

I've a routine that exports a DB query to Excel by building an
XmlDocument and saving to a XmlTextWriter.

The function works but new lines don't show up, i.e. significant
whitespace is cut. I've tried adding WriteAttributeString("xml",
"space", null, "preserve") to the XmlTextWriter just prior to save, but
that results in the error: "Index was outside the bounds of the array."

Can anyone assist?

Many thanks,

Simon Lane
 
Hi Simon:

Have you tried setting the PreserveWhitespace property on your
XmlDocument object to true?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top