internal bool Matches(XML node)
{
Rhino.Xmlimpl.XmlNode.QName qname = node.GetNodeQname();
string nodeUri = null;
if (qname.GetNamespace() != null)
{
nodeUri = qname.GetNamespace().GetUri();
}
if (isAttributeName)
{
if (node.IsAttribute())
{
if (this.Uri() == null || this.Uri().Equals(nodeUri))
{
if (this.LocalName().Equals("*") || this.LocalName().Equals(qname.GetLocalName()))
{
return true;
}
}
return false;
}
else
{
// TODO Could throw exception maybe, should not call this method on attribute name with arbitrary node type
// unless we traverse all attributes and children habitually
return false;
}
}
else
{
if (this.Uri() == null || ((node.IsElement()) && this.Uri().Equals(nodeUri)))
{
if (LocalName().Equals("*"))
{
return true;
}
if (node.IsElement())
{
if (LocalName().Equals(qname.GetLocalName()))
{
return true;
}
}
}
return false;
}
}