public virtual void Normalize()
{
StringBuilder tmpBuilder = new StringBuilder();
int count = this.ChildNodes.Count;
int start = 0;
for (int i = 0; i < count; i++)
{
XmlNode c = ChildNodes [i];
switch (c.NodeType)
{
case XmlNodeType.Text:
case XmlNodeType.Whitespace:
case XmlNodeType.SignificantWhitespace:
tmpBuilder.Append(c.Value);
break;
default:
c.Normalize();
NormalizeRange(start, i, tmpBuilder);
// Continue to normalize from next node.
start = i + 1;
break;
}
}
if (start < count)
{
NormalizeRange(start, count, tmpBuilder);
}
}