internal void RealFoliate()
{
if (!_bNeedFoliate)
{
return;
}
XmlNode n = null;
if (_doc.IsTextOnly(_column))
{
n = _node.FirstChild;
}
else
{
if (_column.ColumnMapping == MappingType.Attribute)
{
n = _node.Attributes.GetNamedItem(_column.EncodedColumnName, _column.Namespace);
}
else
{
for (n = _node.FirstChild; n != null; n = n.NextSibling)
{
if (n.LocalName == _column.EncodedColumnName && n.NamespaceURI == _column.Namespace)
break;
}
}
if (n != null && _fOnValue)
{
n = n.FirstChild;
}
}
if (n == null)
{
throw new InvalidOperationException(SR.DataDom_Foliation);
}
// Cannot use MoveTo( n ); b/c the initial state for MoveTo is invalid (region is foliated but this is not)
_node = n;
_column = null;
_fOnValue = false;
AssertValid();
_bNeedFoliate = false;
}