private bool PathHasDuplicateNamespace(XmlElement top, XmlElement bottom, string localName) {
string namespaceUri = document.strReservedXmlns;
while (bottom != null
&& bottom != top) {
XmlAttribute attribute = bottom.GetAttributeNode(localName, namespaceUri);
if (attribute != null) {
return true;
}
bottom = bottom.ParentNode as XmlElement;
}
return false;
}