private static bool matchId(Element element, idSelector idselector) { if (!string.IsNullOrEmpty(idselector.elementE)) { if (element.tagName != idselector.elementE.ToLower() && idselector.elementE != "*") { return(false); } } if (element.hasAttribute("id")) { string idvalue = element.getAttribute("id"); if (idvalue == idselector.id) { return(true); } else { return(false); } } else { return(false); } }
private void parseIdSelector() { idSelector idselector = new idSelector(); idselector.wholeText = _selectorText; if (_buffer.Length > 0) { idselector.elementE = AppendCleanBuffer(_buffer); } char current = ReadNext(); while (!stop) { _buffer.Append(current); current = ReadNext(); } idselector.id = _buffer.ToString(); simple = idselector; }