Use LoadOptions.PreserveWhitespacewhen parsing XML. C # example code:
using System;
using System.Xml.Linq;
class Test
{
static void Main()
{
string xml = "<Foo> </Foo>";
XElement withWhitespace = XElement.Parse(xml,
LoadOptions.PreserveWhitespace);
Console.WriteLine(withWhitespace.Value.Length);
XElement withoutWhitespace = XElement.Parse(xml);
Console.WriteLine(withoutWhitespace.Value.Length);
}
}
(, Load, Parse ..)
, VB XML, , ..:)