public virtual bool ReadToNextSibling(string localName, string namespaceURI)
{
if (localName == null || localName.Length == 0)
{
throw XmlConvert.CreateInvalidNameArgumentException(localName, nameof(localName));
}
if (namespaceURI == null)
{
throw new ArgumentNullException(nameof(namespaceURI));
}
// atomize local name and namespace
localName = NameTable.Add(localName);
namespaceURI = NameTable.Add(namespaceURI);
// find the next sibling
XmlNodeType nt;
do
{
if (!SkipSubtree())
{
break;
}
nt = NodeType;
if (nt == XmlNodeType.Element && Ref.Equal(localName, LocalName) && Ref.Equal(namespaceURI, NamespaceURI))
{
return true;
}
} while (nt != XmlNodeType.EndElement && !EOF);
return false;
}