I receive xml files from customers to be imported into our database and having some problems with extra spaces appearing between words in some of the field values.
When viewing the xml file in a browser, the values appear formatted properly with a single space between each of the words. But when I read the file into a dataset or even open the file in notepad, wordpad or word, the same text fields would then have a varying amount of spaces between some of the words.
View as XML in browser
View XML in text editor and as appears in dataset field values
Searching the issue I see plenty of links regarding whitespace but this seems more oriented toward the formatting of the file structure itself rather then extra spaces within an element value.
Why is this occuring and is there an easy way to correct it without looping through every record in the file?
When viewing the xml file in a browser, the values appear formatted properly with a single space between each of the words. But when I read the file into a dataset or even open the file in notepad, wordpad or word, the same text fields would then have a varying amount of spaces between some of the words.
View as XML in browser
VB.NET:
<myDataSet>
<myTable>
<myColumn>[COLOR="Red"]My Item Text Value Here[/COLOR]</myColumn>
</myTable>
<myTable>
<myColumn>[COLOR="red"]My Item Text Value Here[/COLOR]</myColumn>
</myTable>
</myDataSet>
View XML in text editor and as appears in dataset field values
VB.NET:
<myDataSet>
<myTable>
<myColumn>[COLOR="red"]My Item Text Value Here[/COLOR]</myColumn>
</myTable>
<myTable>
<myColumn>[COLOR="red"]My Item Text Value Here[/COLOR]</myColumn>
</myTable>
</myDataSet>
Searching the issue I see plenty of links regarding whitespace but this seems more oriented toward the formatting of the file structure itself rather then extra spaces within an element value.
Why is this occuring and is there an easy way to correct it without looping through every record in the file?