private TaggedXmlElement FindById(TaggedXmlElement parent, int id) { if (parent.Id == id) { return(parent); } foreach (var child in parent.Elements) { var match = FindById(child, id); if (match != null) { return(match); } } return(null); }
public TaggedXmlDoc(XmlDocument doc, XmlSelector selector) { // tag each node using XPath selector this.doc = doc.Clone() as XmlDocument; Root = TagNodeWithXPath(this.doc, selector); }
public TaggedXmlDoc(XmlDocument doc) { // tag each node incrementally this.doc = doc.Clone() as XmlDocument; Root = TagNodeIncrementally(this.doc.DocumentElement, 0); }