Technocratic
Programmer
I am writing an XML file by parsing apart a text file... there are instances when there are spaces at the start or end of some of the fields, and I need to be able to see those for validation purposes.
So if an Incident number is in the text file as " CA00456" I need to have those leading blanks in the XML file, however when I use:
it automatically trims it so I end up with "CA00456"
Is there a way to preserve those spaces in the XML?
I know there is a WriteWhitespace method, but it seems that I might end up having to test each field for spaces as I'm writing, and write the appropriate number of spaces before or after the field... and I'm hoping for a simple property or something that will just tell it to keep the spaces!
Any input much appreciated!
So if an Incident number is in the text file as " CA00456" I need to have those leading blanks in the XML file, however when I use:
Code:
XMLTextWriter4.WriteElementString(NodeName, CurrentField)
it automatically trims it so I end up with "CA00456"
Is there a way to preserve those spaces in the XML?
I know there is a WriteWhitespace method, but it seems that I might end up having to test each field for spaces as I'm writing, and write the appropriate number of spaces before or after the field... and I'm hoping for a simple property or something that will just tell it to keep the spaces!
Any input much appreciated!