internal bool MoveToAttribute(string localName, string namespaceURI)
{
RealFoliate();
AssertValid();
if (namespaceURI == StrReservedXmlns)
return false;
if (_node != null)
{
//_column.ColumnMapping checkin below is not really needed since the pointer should be pointing at the node before this
// function should even be called ( there is always a call MoveToOwnerElement() before MoveToAttribute(..)
if ((_column == null || _column.ColumnMapping == MappingType.Attribute) && _node.NodeType == XmlNodeType.Element)
{
if (!IsFoliated(_node))
{
DataColumn c = null;
while ((c = NextColumn(Row, c, true)) != null)
{
if (c.EncodedColumnName == localName && c.Namespace == namespaceURI)
{
MoveTo(_node, c, false);
return true;
}
}
}
else
{
Debug.Assert(_node.Attributes != null);
XmlNode n = _node.Attributes.GetNamedItem(localName, namespaceURI);
if (n != null)
{
MoveTo(n, null, false);
return true;
}
}
}
}
return false;
}